18F / fbopen

[DEPRECATED] An open API server, data import tools, and sample apps to help small businesses search for opportunities to work with the U.S. government.
Other
101 stars 45 forks source link

Duplicate analytics #178

Open geramirez opened 9 years ago

geramirez commented 9 years ago

There appear to be 2 instance of Google Analytics on the site: on the index page and in the config.js file. The UA code on the index page is the one 18F uses.

Also, we've refined the customizations that we use. The snippet should be the one below. Do you mind changing the current version to the one below:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', '<<UA-CODE>>', 'auto');
ga('set', 'anonymizeIp', true);
ga('set', 'forceSSL', true);
ga('send', 'pageview');
</script>
gbinal commented 9 years ago

Thanks, @ramirezg.

This should be applied to the analytics of https://fbopen.gsa.gov/ and https://pages.18f.gov/fbopen/, both.

stvnrlly commented 8 years ago

The two tracking codes have different property IDs. It looks like the one on the index page uses the correct ID, while config.js has the wrong ID.