Flite

The following presents a guideline on how Flite standard and rich media tags should be edited to count clicks in Google Ad Manager. In order to track clicks follow the procedure below:

JavaScript Code

Original Code

You should have received some JavaScript code from Flite that looks similar to the following example:

<script type="text/javascript">
(function(){
  var r = top===self ? top.location.href : document.referrer || top.location.href, m = r.match(new RegExp("[A-Za-z]+:[/][/][A-Za-z0-9.-]+")), c = 'ENTER_CLICK_MACRO', e = encodeURIComponent;
  var src = ['//r.flite.com/syndication/adframe/i/ted53464-74t4-6g36-g35d-d12g3s46hd4g?v=3&dep=FIF&p=',e(c),'&cb=',Math.random(),'&d=',e((m && m[0]) || r)].join('');
  document.write('<div style="border:0px;width:300px;position:relative;"><iframe style="border:0px;height:250px;width:300px;" scrolling="no" frameborder="0" seamless="seamless" allowTransparency="true" src="' + src + '"></iframe></div>');
})();
</script>
<noscript>
  <a style="text-decoration:none;display:block;border:0;" href="//r.flite.com/syndication/backuplink/i/ted53464-74t4-6g36-g35d-d12g3s46hd4g?ct=ENTER_CLICK_MACRO" target="_blank">
    <img border="0" src="//r.flite.com/syndication/backupimage/i/ted53464-74t4-6g36-g35d-d12g3s46hd4g?"/>
  </a>
</noscript>

Modified Code

What you need to do is modify the URL in the <SCRIPT> tag by replacing the ENTER_CLICK_MACRO placeholder with %%CLICK_URL_ESC%% as shown by the highlighted changes, The resulting tag should look similar to the following example:

<script type="text/javascript">
(function(){
  var r = top===self ? top.location.href : document.referrer || top.location.href, m = r.match(new RegExp("[A-Za-z]+:[/][/][A-Za-z0-9.-]+")), c = '%%CLICK_URL_ESC%%', e = encodeURIComponent;
  var src = ['//r.flite.com/syndication/adframe/i/ted53464-74t4-6g36-g35d-d12g3s46hd4g?v=3&dep=FIF&p=',e(c),'&cb=',Math.random(),'&d=',e((m && m[0]) || r)].join('');
  document.write('<div style="border:0px;width:300px;position:relative;"><iframe style="border:0px;height:250px;width:300px;" scrolling="no" frameborder="0" seamless="seamless" allowTransparency="true" src="' + src + '"></iframe></div>');
})();
</script>
<noscript>
  <a style="text-decoration:none;display:block;border:0;" href="//r.flite.com/syndication/backuplink/i/ted53464-74t4-6g36-g35d-d12g3s46hd4g?ct=%%CLICK_URL_ESC%%" target="_blank">
    <img border="0" src="//r.flite.com/syndication/backupimage/i/ted53464-74t4-6g36-g35d-d12g3s46hd4g?"/>
  </a>
</noscript>

Note

The ad server recognises the [timestamp] placeholder and will automatically replace it with a cache buster. It is not necessary to convert it to the %%CACHEBUSTER%% macro manually.

Use %%CLICK_URL_UNESC%% at the beginning of a link. Use %%CLICK_URL_ESC%% when the click-tracker is the parameter of another URL.

<a href="%%CLICK_URL_UNESC%%https://www.google.com">link</a>
<a href="https://www.google.com?rd_url=%%CLICK_URL_ESC%%">link</a>