Also if you do want to upgrade Mark you can override the footer scripts template in your own project, I've done that before myself to take advantage of some of the new features of universal analytics. I haven't had any problems with the current script not working as is though.
On Wed, Jan 28, 2015 at 3:22 AM, Stephen McDonald <[email protected]> wrote: > There's a recent relevant discussion here: > https://github.com/stephenmcd/mezzanine/pull/1191 > > Apparently the code should work fine as is. > > On Wed, Jan 28, 2015 at 7:19 PM, Mark Doukidis <[email protected]> > wrote: > >> Having trouble getting Google Analytics to acknowledge a sites tracking >> code. >> >> I can see it in the generated pages and looks okay. >> >> Have noticed that the code in Mezzanine was last updated in 2012 and >> wondered if it needs updating as it appears quite different from the >> suggested code from Google. >> >> Google's suggestion: >> >> <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','//www.google-analytics.com/analytics.js >> ','ga'); >> >> ga('create', 'UA-XXXXXX-1', 'auto'); >> ga('send', 'pageview'); >> >> </script> >> >> >> Mezzanine's code: >> >> <script> >> {% if settings.GOOGLE_ANALYTICS_ID and not request.user.is_staff %} >> var _gaq = _gaq || [['_trackPageview']]; >> _gaq.unshift(['_setAccount', '{{ settings.GOOGLE_ANALYTICS_ID }}']); >> (function(d, t) { >> var g = d.createElement(t), >> s = d.getElementsByTagName(t)[0]; >> g.async = true; >> g.src = '//www.google-analytics.com/ga.js'; >> s.parentNode.insertBefore(g, s); >> })(document, 'script'); >> {% endif %} >> </script> >> >> >> Anyone experiencing any issues with the code ? >> >> >> regards >> >> mark >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mezzanine Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Stephen McDonald > http://jupo.org > > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
