Asynchronous Google Tracking Code, Verification and Merchant Account
Client has v12 site with built in SD Google analytics tracking. He ran into some issues and I saw he had added a second block of Google Analytics code to the head which was though the be causing javascript conflicts so I removed it. The Usual code in the footer was still visible on 'view source' but Google decided that his site was no longer verified and unclaimed his site from his Google Merchant Account.
I opened Google Analytics Tracking Code in Design Library and replaced the code with the new code incorporating (hopefully correctly - please can anyone check) the receipt page bit.
Saved and placed in Javascript Header Functions at the bottom and removed from the bottom of the outer layouts. Once the new code was in place I was able to re-verify the site and reclaim the URL in Google Merchant. All because Google now only looks in the head section for the analytics code!
Here is the new code:
Please remember I am not a great coding expert, I haven't touched the other google layouts in the design library. Will any of these other layouts now need changing?
Thank you
Client has v12 site with built in SD Google analytics tracking. He ran into some issues and I saw he had added a second block of Google Analytics code to the head which was though the be causing javascript conflicts so I removed it. The Usual code in the footer was still visible on 'view source' but Google decided that his site was no longer verified and unclaimed his site from his Google Merchant Account.
I opened Google Analytics Tracking Code in Design Library and replaced the code with the new code incorporating (hopefully correctly - please can anyone check) the receipt page bit.
Saved and placed in Javascript Header Functions at the bottom and removed from the bottom of the outer layouts. Once the new code was in place I was able to re-verify the site and reclaim the URL in Google Merchant. All because Google now only looks in the head section for the analytics code!
Here is the new code:
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsGoogleAnalyticsEnabled%22%20%2f%3e%20%3d%3d%20true" > <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '<actinic:variable name="GoogleAnalyticsNumber" />']); _gaq.push(['_trackPageview'<actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22">,'/receipt.html'</actinic:block>]); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga' + '.' + 'js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </actinic:block>
Please remember I am not a great coding expert, I haven't touched the other google layouts in the design library. Will any of these other layouts now need changing?
Thank you
Comment