Last active
December 14, 2015 14:48
-
-
Save agassan/5102701 to your computer and use it in GitHub Desktop.
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
//NOTE: | |
//getUrlVars() should be global function | |
//add jQuery cookies library (https://github.com/carhartl/jquery-cookie) | |
//Global function | |
function getUrlVars() { | |
var vars = {}; | |
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | |
vars[key] = value; | |
}); | |
return vars; | |
}; | |
//Tracking | |
var utm_source = getUrlVars()["utm_source"]; | |
var utm_medium = getUrlVars()["utm_medium"]; | |
if (utm_source && utm_medium) { | |
$.cookie('tracking_source', utm_source); | |
$.cookie('tracking_action', utm_medium); | |
}; | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-20239101-3']); | |
_gaq.push(['_trackPageview']); | |
//Track events based on source and medium | |
if (utm_source && utm_medium) { | |
_gaq.push(['_trackEvent', utm_source, utm_medium, 'visit']); | |
}; | |
(function() { | |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
})(); | |
//Woopra | |
function woopraReady(tracker) { | |
tracker.setDomain('ibuildapp.com'); | |
tracker.setIdleTimeout(1800000); | |
tracker.trackPageview({type:'pageview',url:window.location.pathname+window.location.search,title:document.title}); | |
//Track events based on source and medium | |
if (utm_source && utm_medium) { | |
tracker.pushEvent({ | |
name: utm_source, | |
action: utm_medium, | |
label: 'visit' | |
}); | |
}; | |
return false; | |
} | |
(function() { | |
var wsc = document.createElement('script'); | |
wsc.src = document.location.protocol+'//static.woopra.com/js/woopra.js'; | |
wsc.type = 'text/javascript'; | |
wsc.async = true; | |
var ssc = document.getElementsByTagName('script')[0]; | |
ssc.parentNode.insertBefore(wsc, ssc); | |
})(); | |
//Crazyegg | |
setTimeout(function(){var a=document.createElement("script"); | |
var b=document.getElementsByTagName("script")[0]; | |
a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0013/9759.js?"+Math.floor(new Date().getTime()/3600000); | |
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1); | |
//Adroll | |
adroll_adv_id = "Z6VN3OFMHNBKPL442T4UAB"; | |
adroll_pix_id = "MI4SDOBCIBBABIECJL3MDD"; | |
(function () { | |
var oldonload = window.onload; | |
window.onload = function(){ | |
__adroll_loaded=true; | |
var scr = document.createElement("script"); | |
var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com"); | |
scr.setAttribute('async', 'true'); | |
scr.type = "text/javascript"; | |
scr.src = host + "/j/roundtrip.js"; | |
((document.getElementsByTagName('head') || [null])[0] || | |
document.getElementsByTagName('script')[0].parentNode).appendChild(scr); | |
if(oldonload){oldonload()}}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment