Created
March 31, 2011 15:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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