Closed homecoded closed 9 years ago
As a reminder, here is the previous communication (in parts) for the issue:
Hello Kristof,
we are using your awesome extension "Google Analytics Plus" in one of our customer projects. Our customer is using the "Google Tag Assistant" that analyses the ga-code on a page. It always keeps complaining about the code, your extension generates.
Now, the GA code coming from "Google Analytics Plus" is perfectly fine. "Google Tag Assistant" is wrong on this one.
So, what's going on? The problem lies in the spaces. Here is some code that was generated by "Google Analytics Plus":
<!-- BEGIN GOOGLE ANALYTICS CODE -->
<script>
/* <![CDATA[ */
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = 'https://stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-5XXXXXXX-X'] ,['_setDomainName','homecoded.com'], ['_gat._anonymizeIp'], ['_trackPageview','/store']);
/* ]]> */
</script>
<!-- END GOOGLE ANALYTICS CODE -->
Do you notice the odd space after the _setAccount array (before ",['_setDomainName")? If I switch the comma and the space around, things are fine with "Google Tag Assistant".
...
Thanks for the investigative work and fix.
switched a comma and space around, so "Google Tag Assistant" (chome extension) will not (falsely) flag the _setAccount-command as being invalid