Floodlight conversion tracking

Floodlight cache busting script examples

Cache busting scripts are used with standard counters, which count all events, and unique counters, which count unique visitors.

Cache busting is not used with per session counters, which count unique users only once per session, because it's up to you to determine how sessions are counted and to pass a unique session ID to the Floodlight tag. Similarly, they're not used with sales tags, because the order ID that you pass to the tag already makes each request unique.

The following examples show what the code looks like for each cache busting option with Floodlight tags. If you're using image tags instead of Iframe tags for your Floodlight implementation, simply replace the Iframe tags shown below with your image tags.

Notice that the difference between each standard counter and unique counter of the same type is in how the ord= and num= key-values are used:

  • In standard counter tags, the ord= key-value is used for the random number, and there's no num= key-value.

  • In unique counter tags, the ord= key-value has a hard-coded value of 1, and the num= key-value is used for random number insertion.

These are examples only. Do not copy and paste them into your website code, because they won't work. Instead, use the Floodlight tags that are created in DFA Trafficking.
 

JavaScript examples

Standard counter

The following example shows a JavaScript counter tag using the standard counting method, which counts each event.

<script type="text/javascript">
var axel = Math.random() + "";
var a = axel * 10000000000000;
document.write('<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
</script>
<noscript>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</noscript>

Unique counter

The following example shows a JavaScript counter tag using the unique counting method, which counts the number of unique users per 24-hour period.

<script type="text/javascript">
var axel = Math.random() + "";
var a = axel * 10000000000000;
document.write('<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
</script>
<noscript>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</noscript>

XHTML-compliant standard counter

The following example shows an XHTML-compliant JavaScript counter tag using the standard counting method, which counts each event.

<script type="text/javascript" id="DoubleClickFloodlightTag123456">
//<![CDATA[
var axel = Math.random() + "";
var a = axel * 10000000000000;
var newIFrame=document.createElement('iframe');
newIFrame.src='http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=' + a + '?';
newIFrame.width="1";
newIFrame.frameborder="0";
newIFrame.height="1";
var scriptNode=document.getElementById('DoubleClickFloodlightTag123456');
scriptNode.parentNode.insertBefore(newIFrame,scriptNode);
//]]>
</script>
<noscript>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</noscript>

XHTML-compliant unique counter

The following example shows an XHTML-compliant JavaScript counter tag using the unique counting method, which counts the number of unique users per 24-hour period.

<script type="text/javascript" id="DoubleClickFloodlightTag123456">
//<![CDATA[
var axel = Math.random() + "";
var a = axel * 10000000000000;
var newIFrame=document.createElement('iframe');
newIFrame.src='http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=' + a + '?';
newIFrame.width="1";
newIFrame.frameborder="0";
newIFrame.height="1";
var scriptNode=document.getElementById('DoubleClickFloodlightTag565853');
scriptNode.parentNode.insertBefore(newIFrame,scriptNode);
//]]>
</script>
<noscript>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</noscript>
 

ASP examples

Standard counter

The following example shows an ASP counter tag using the standard counting method, which counts each event.

<% Randomize() %>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=<%Response.Write(int(rnd()*3141581723+10)) %>?" width="1" height="1" frameborder="0" style="display:none"></iframe>

Unique counter

The following example shows an ASP counter tag using the unique counting method, which counts the number of unique users per 24-hour period.

<% Randomize() %>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=<%Response.Write(int(rnd()*3141581723+10)) %>?" width="1" height="1" frameborder="0" style="display:none"></iframe>
 

JSP examples

Standard counter

The following example shows a JSP counter tag using the standard counting method, which counts each event.

<% long random_number = (long) (Math.random()*100000000); %>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=<%= random_number %>?" width="1" height="1" frameborder="0" style="display:none"></iframe>

Unique counter

The following example shows a JSP counter tag using the unique counting method, which counts the number of unique users per 24-hour period.

<% long random_number = (long) (Math.random()*100000000); %>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=<%= random_number %>?" width="1" height="1" frameborder="0" style="display:none"></iframe>
 

PHP examples

Standard counter

The following example shows a PHP counter tag using the standard counting method, which counts each event.

<? $t= time() ?>
<iframe src="<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=<? echo $t ?>?" width="1" height="1" frameborder="0" style="display:none"></iframe>

Unique counter

The following example shows a PHP counter tag using the unique counting method, which counts the number of unique users per 24-hour period.

<? $t= time() ?>
<iframe src="<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=<? echo $t ?>?" width="1" height="1" frameborder="0" style="display:none"></iframe>
 

ColdFusion examples

Standard counter

The following example shows a ColdFusion counter tag using the standard counting method, which counts each event.

<CFSET randnum = RandRange(1000000, 9999999)>
<CFOUTPUT>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=#randnum#?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</CFOUTPUT>

Unique counter

The following example shows a ColdFusion counter tag using the unique counting method, which counts the number of unique users per 24-hour period.

<CFSET randnum = RandRange(1000000, 9999999)>
<CFOUTPUT>
<iframe src="http://1234567.fls.doubleclick.net/activityi;src=1234567;type=abcde123;cat=fghij456;u1=[friendlyname1];u2=[friendlyname2];ord=1;num=#randnum#?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</CFOUTPUT>