Created
April 14, 2012 14:49
-
-
Save replete/2384908 to your computer and use it in GitHub Desktop.
Check domain before running domain-specific code, e.g. analytics
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
if (document.location.hostname.indexOf("mydomain.com") > -1) { | |
//GA: Event Tracking, for example | |
$("a[href$=pdf]").click(function () { | |
var name = $(this).attr("title") || ""; | |
_gaq.push(['_trackEvent', 'PDF', 'Download', name]); | |
}); | |
//etc | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment