Skip to content

Instantly share code, notes, and snippets.

@andrewkolesnikov
Created March 31, 2011 15:44
Show Gist options
  • Save andrewkolesnikov/896607 to your computer and use it in GitHub Desktop.
Save andrewkolesnikov/896607 to your computer and use it in GitHub Desktop.
Helper for DoubleClick tracking codes tags in ruby on rails Rails3 with haml
#
# Helper
#
module ApplicationHelper
#
# DoubleClick tracking codes
#
def doubleclicksrc
'xxxxxx'
end
def doubleclicktype
'xxxxxx'
end
# your tracking codes here ad provided from the table
def doubleclickcat
{
'/' => 'xxxxxXXX', # more sample codes
'/collection/jeans/trends' => 'trend597',
'/collection/jeans/styles' => 'style357',
'/collection/jeans/wash' => 'washl072',
'/collection/jeans/details' => 'detai253'
}.values_at request.request_uri
end
end
#
# Layout
#
/
Start of DoubleClick Floodlight Tag: Please do not remove
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 03/30/2011
:javascript
var axel = Math.random() + "";
var a = axel * 10000000000000;
document.write('<iframe src="http://fls.doubleclick.net/activityi;src=#{doubleclicksrc};type=#{doubleclicktype};cat=#{doubleclickcat};ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
%noscript
%iframe{:frameborder => "0", :height => "1", :src => "http://fls.doubleclick.net/activityi;src=#{doubleclicksrc};type=#{doubleclicktype};cat=#{doubleclickcat};ord=1?", :style => "display:none", :width => "1"}
/ End of DoubleClick Floodlight Tag: Please do not remove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment