Google tracking codes
Autor: Paul H.
Visited 1071,
Followers 1,
Udostępniony 0
Hello,
i Have a problem with a google tracking code.
When I insert it into my website file, the programme locks up and the preview ceases to work.
Do you have any ideas
Posted on the
Hello Paul,
Where are you exactly adding the tracking codes in the program?
Do you get any error message?
Many thanks!
Autor
It was directly copied from Google an pasted to the correct place. No error message, just slow to review - 60-120 secs to preview the website
I have have discovered that it is a problem with google new code(below).
<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[removed].insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-6358886-1', 'protect-it.com.au');
ga('send', 'pageview');
</script>
I discovered that old code(below) was not a problem so I revereted back to the old code and the problem was fixed
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6358886-1']);
_gaq.push(['_trackPageview']);
(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[removed].insertBefore(ga, s);
})();
</script>
Have you experienced problems with this new code
Regards, Paul
Hello Paul,
This code stops the loading until a connection to the server of google is done and the website probably verified. For the preview, in case you want to use the new code, it is better to remove it until you decide to upload it since this depends directly from the code which probably tries to verify the domain and since it runs locally it is delayed.
Many thanks!