Floodlight conversion tracking

Pass values to variables in Floodlight dynamic tags

Floodlight activity tags can contain a variety of variables that the advertiser's website populates dynamically when the Floodlight activity code is served. In some cases, you might want to include the same variables and values in the dynamic tags (default or publisher tags) that you've added to your Floodlight activity. To do so, you can use the %p pattern match macro.

You can use the Macro Builder tool to help you add macros to your ad tags.


About variables in Floodlight tags

There are two types of variables that are used in Floodlight tags:

  • Standard variables: Floodlight tags can include the standard variables qty=, cost=, ord=, and num=.

  • Custom variables: You can also choose to include custom Floodlight variables in any of your Floodlight activity tags. They take the form u1=, u2=, and so on.

Learn more about standard and custom variables


Examples of variables in Floodlight tags

Here's an example Floodlight sales tag before the variable values are inserted dynamically:

<iframe src="https://1234567.fls.doubleclick.net/activityi;src=1234567;type=type123;cat=cat1234;qty=1;cost=[Revenue];u1=[Product Category];ord=[OrderID]?" width="1" height="1" frameborder="0"></iframe>

Let's focus just on the variables:

cost=[Revenue];u1=[Custom Variable 1];ord=[OrderID]?

Here's what the variables look like once they've been populated with data by the advertiser's web server:




Use %p to pass variables and values to publisher and default tags

The %p macro captures any substring within a request path, then passes it in a redirect URL. The macro uses the following format:


Replace [start_key_string] with the key part of the key-value whose value you want to pass into the default or publisher tag. For example, if you're passing the value of the ord= key-value, the [start_key_string] is ord=. The [end_character] is typically a semicolon (;) to separate multiple key-values, or a question mark (?) to end the string. For example, the complete key-value to pass ord= would be order=%pord=!?.

If you use Google Tag Manager: End your string with a semi-colon, not a question mark. Floodlight tags delivered by Google Tag Manager should not include question marks anywhere. For example, to pass an ord= value through GTM, your string would be order=%pord=!;.



Tag example

In this example, you're using a 1x1-pixel GIF tag for tracking purposes, and including the tag in your default tags.


Placeholder tag:

Here's the 1x1-pixel tag, with placeholders for the information you want to include:

<img src="https://www.mywebsite.com?price=[price]&category=[category]&order=[orderID]" height="1" width="1" />

Notice that you're creating new key-values. The new key can be anything you like (in this case, price, category, and order).


Tag with macros:

Using the %p macro, you replace the placeholders as follows:

<img src="https://www.mywebsite.com?price=%pcost=!;&category=%pu1=!;&order=%pord=!?" height="1" width="1" />

For each key-value, the value is %p, then the key part of the original key-value from the Floodlight tag, then an equals sign (=) and exclamation point (!). You can use this structure to import any key-value from the original Floodlight tag.

If it's the last key-value in the tag, end with a question mark (?). For other key-values, end with a semicolon (;). Notice that the original ampersand (&) separator remains in place. That's necessary because the question mark and semicolons are removed when the macros are expanded.


Tag with expanded macros:

When the macros are expanded, the new value is the original value of the key you referenced with the %p macro.

<img src="https://www.mywebsite.com?price=19.95&category=books&order=BUY12834988?" height="1" width="1" />


Was this article helpful?
How can we improve it?