Last active
December 25, 2015 21:39
-
-
Save tomfuertes/7043966 to your computer and use it in GitHub Desktop.
How to include gas
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
<script> | |
var _gas = _gas || []; | |
_gas.push(['_setAccount', 'UA-YYYYYY-Y']); // REPLACE WITH YOUR GA NUMBER | |
_gas.push(['_setDomainName', '.mydomain.com']); // REPLACE WITH YOUR DOMAIN | |
_gas.push(['_trackPageview']); | |
_gas.push(['_gasTrackForms']); | |
_gas.push(['_gasTrackOutboundLinks']); | |
_gas.push(['_gasTrackMaxScroll']); | |
_gas.push(['_gasTrackDownloads']); | |
_gas.push(['_gasTrackYoutube', {force: true}]); | |
_gas.push(['_gasTrackVimeo', {force: true}]); | |
_gas.push(['_gasTrackMailto']); | |
(function() { | |
var ga = document.createElement('script'); | |
ga.id = 'gas-script'; // REQUIRED FOR DC.JS SUPPORT | |
ga.setAttribute('data-use-dcjs', 'true'); // TRUE USES DC.JS | |
ga.type = 'text/javascript'; | |
ga.async = true; | |
ga.src = '//cdn.example.com/scripts/gas.min.js'; // REPLACE WITH YOUR SCRIPT | |
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