google / web-starter-kit

Web Starter Kit - a workflow for multi-device websites
http://developers.google.com/web/starter-kit
Apache License 2.0
18.42k stars 3.01k forks source link

Update Google Analytics snippet #881

Closed bransbury closed 6 years ago

bransbury commented 8 years ago

I was looking at the Google Developer site and noticed this starter kit is using the old Google Analytics snippet. For newer browsers the following snippet is recommended:

<!-- Google Analytics -->
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->

Source: https://developers.google.com/analytics/devguides/collection/analyticsjs/

This change would involve updating:

I'm happy to submit a PR if the proposed update is accepted.

gauntface commented 6 years ago

Added a note to #940 to fix this.