Skip to content

Instantly share code, notes, and snippets.

@chrisking
Created May 24, 2012 18:12
Show Gist options
  • Select an option

  • Save chrisking/2783206 to your computer and use it in GitHub Desktop.

Select an option

Save chrisking/2783206 to your computer and use it in GitHub Desktop.
JS for client
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount','UA-3002088-4']);
_gaq.push(['_setAllowLinker',true],['_setDomainName','www.nextgengovt.com'],['_trackPageview']);
(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);
})();
</script>
<script type="text/javascript">
//Find all examples and iterate through the links to correct GA functionality
$('a[href$="http://nextgengovt.eventbrite.com"]').each(function(){
$(this).click(function(){
_gaq.push(['_link', 'http://nextgengovt.eventbrite.com/']);
if ((document.referrer).search("google")){
_gaq.push(['_setCampNameKey', 'google.com']);
}
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment