- TLC Home Home
- Discussions & Ideas Discussions & Ideas
- Product Guides Product Guides
- Knowledge Base Knowledge Base
- Developer Docs Developer Docs
- Education Education
- Blog TLC Blog
- Support Desk Support Desk
If you have many Floodlight tags, all with a slightly different configuration, but based on the same load criteria, for example, different paths in the URL, rather than setting up several similar instances of the Floodlight tag, each with different load rules and configuration values, you can combine them into one instance of the Floodlight tag using some additional configuration.
Floodlight was previously marketed as "DoubleClick Floodlight".
In this article:
This multi-tag solution uses data mappings to set the Floodlight parameters dynamically and a lookup table to set the Floodlight values based on a data layer variable. The lookup table creates a delimited string containing multiple values per entry which can then be separated into individual Floodlight parameters using a JavaScript Code extension.
You will need the following variables for the data mappings in the Floodlight tag and for the lookup table extension. The "dc_" prefix is a best practice to remind you that these variables are used for the Floodlight configuration.
Create the following:
In this multi-tag solution the Floodlight parameters will be set dynamically based on the output of the lookup table extension, so the values must be set in the tag configuration using data mappings.
Set the following data mappings:
dc_advertiserId
set to src
dc_counterType
set to countertype
dc_type
set to type
dc_category
set to cat
Once completed the mappings will look like this:
This solutions uses three extensions to construct all of the Floodlight tags we intend to fire. The following extensions will be added and must be ordered as they appear here:
This extension will be used to set a delimited string based on a criteria variable. In this example, the criteria variable is the pathname
variable and the delimited string is the dc_settings
variable set in the following format:
ADVERTISER ID|TYPE|CATEGORY|COUNTERTYPE
To add this extension:
pathname
dc_settings
Each lookup table entry will contain a URL pathname and a delimited string value. This example uses the following entries:
Pathname | Output |
---|---|
/test1/test | 321123|Testing|Test001|standard |
/test2/test/something.htm | 321123|Testing|Test002|standard |
/test1/docs | 321123|Docs|Test003|standard |
The Lookup Table extension should appear as follows:
Use the Import from CSV... option to manage long lists.
This extension will separate the delimited string into separate Floodlight variables.
To add this extension:
Set Variable | Value Type | Value |
dc_advertiserId | JS Code | b['dc_settings'].split("|")[0] |
dc_type | JS Code | b['dc_settings'].split("|")[1] |
dc_category | JS Code | b['dc_settings'].split("|")[2] |
dc_counterType | JS Code | b['dc_settings'].split("|")[3] |
The extension should appear as follows:
Use the Add Condition to test that dc_settings
is populated to ensure this will only run when there is a value.
This extension will suppress the Floodlight tag if the lookup table extension did not output a value (i.e. there is no tag to fire). This means that you can keep the "All Pages" load rule set on the Floodlight tag and it will not fire if there is no configuration for the current page.
To add this extension:
if(b['dc_settings']===''){
return false;
}
Copyright All Rights Reserved © 2008-2021