Analytics
4K members online now
4K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Help Help autotrack Issues

[ Edited ]
Explorer ✭ ✭ ✭
# 1
Explorer ✭ ✭ ✭

I have used this code for autotrack but failed .Anybody knows step by step how autotrack can be enabled in case of blogger and general website.I followed google's guidelines but it is giving error in blogger.Anybody if you know please guide me step by step.

 

<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-74396724-1', 'auto');

ga('require,'autotrack', );
ga('send', 'pageview');

</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script async src='path/to/autotrack.js'></script>

1 Expert replyverified_user

Re: Help Help autotrack Issues

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
You need to update the path to the autotrack.js file so that it's referencing it correctly. Change 'path/to' to the correct path of this file on your website.

Re: Help Help autotrack Issues

Top Contributor
# 3
Top Contributor
Hi,

Did you upload the autotrack.js file to your webserver? Make sure the path is correct as mentioned before.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Help Help autotrack Issues

[ Edited ]
Explorer ✭ ✭ ✭
# 4
Explorer ✭ ✭ ✭

Arnold should i have to upload the autotrack.js file to my webserver,then specify the path?I was not aware of it.
If i do that rest of my code is ok?

Re: Help Help autotrack Issues

Top Contributor
# 5
Top Contributor
Hi,

Yes, upload the file and specify the path in the code. The rest of the code is fine.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Help Help autotrack Issues

Explorer ✭ ✭ ✭
# 6
Explorer ✭ ✭ ✭
Thanks Arnold.

But i want to implement it with blogger how can i do this?

Re: Help Help autotrack Issues

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

I have the same problem.. Can you verify the problem in my code

 

Here is the new code that is not working

 

<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-xxx-x', 'auto');
ga('require', 'autotrack');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script async src='https://www.geospatialworld.net/wp-content/plugins/google%20analytics-js/autotrack.js'></script>


Here is the old code that is working

<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','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-xxx-x', 'auto');
ga('send', 'pageview');

</script>

Help Help autotrack Issues

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

I have the same problem, after adding the following line:

 

ga('require', 'autotrack');

 

GA not work anymore :-(