Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2435 from 18F/ms-fix_analytics
Browse files Browse the repository at this point in the history
Only keep analytics on production
  • Loading branch information
Marco Segreto authored Nov 6, 2017
2 parents b4f5e28 + c894e59 commit 7cb873d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _includes/google_analytics.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<!-- Digital Analytics Program roll-up, see the data at https://analytics.usa.gov -->
<script src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js" id="_fed_an_ua_tag"></script>


{% assign ga_id = site.google_analytics[site.branch]|default:site.google_analytics.default %}
{% if ga_id %}
<script>
// Google Analytics
(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', '{{ include.id }}', 'auto');
ga('create', '{{ ga_id }}', 'auto');
ga('set', 'anonymizeIp', true);
ga('set', 'forceSSL', true);
ga('send', 'pageview');
</script>
{% endif %}

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
Expand Down

0 comments on commit 7cb873d

Please sign in to comment.