Closed jackiekazil closed 9 years ago
This might just be me, but I would rather have something that I can copy easily. So the complete block with the setting we're asking works for me.
That's not quite right -- the README as it stands right now asks people to use this snippet:
(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');
This also includes a tweak to change //www.google-analytics.com/analytics.js
to https://www.google-analytics.com/analytics.js
.
So @jackiekazil, given that we're changing something about the guts of the snippet, I agree that we should be giving people something to copy and paste. It looks like we are? Or do you recommend we add <script>
and <script/>
tags around it as well?
I'll also note that it's crucial that ga('send', 'pageview')
come last, so just giving people a couple of lines to paste in somewhere is bound to increase the chance of error.
From what I can tell though, I'm already fine with the state of the README.
This is superseded by #28.
Nice!
This snippet is not incomplete.
Here is a sample default of what google analytics provides:
Here is what we are asking people to add to that...
I am thinking we should update it, so that is show an image of what google analytics provides and how to navigate to it, then ask folks to add the items in the second block listed above.
OR
I am thinking that we should update it to show a sample snippet that is complete without the UA code, then tell people where to find the UA code.
Discuss... how should we update?