Last active
October 11, 2015 20:58
-
-
Save hsquareweb/3918494 to your computer and use it in GitHub Desktop.
JS: Google Analytics
This file contains hidden or 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
<a href="/docs/default-source/food-safety/avian-influenza-talking-points.pdf?sfvrsn=2" onClick="_gaq.push(['_trackEvent', 'Button Call To Action', 'Click', 'Avian Flu PDF']);">click here</a> |
This file contains hidden or 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
<!---------------------- | |
1. Download "entourage.min.js" | |
http://techoctave.com/entourage/download/entourage.zip | |
---------------------- !> | |
<!---------------------- | |
2. Add Google Analytics in Header | |
---------------------- !> | |
<script src="/js/entourage.min.js"></script> | |
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-0000000-0']); | |
_gaq.push(['_trackPageview']); | |
</script> | |
<!---------------------- | |
3. Add Google Analytics in Footer | |
---------------------- !> | |
<script type="text/javascript"> | |
(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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment