Analytics
1.6K members online now
1.6K 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

Google Analytics Code Not Tracking

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

We are having trouble with our Google Analytics code tracking data on our site. We would greatly appreciate some help troubleshooting this issue. 

 

Here is our website link:

http://nynmedia.com/

 

If anyone is also familiar with TextPattern that would really help. We currently have our GA script in the footer template.

 

Thanks!

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Chanelle G
November 2015

Re: Google Analytics Code Not Tracking

Top Contributor
# 4
Top Contributor
Hi Chanelle,

If you don't know what GTM is, then likely you wouldn't need that on the page. GTM is Google Tag Manager, and it is a tag management system that helps you track events and user interactions into your GA. It embodies the standard features of GA (so whatever you do in GA can also be done in GTM), but GTM has the ability to do things much more conveniently through templated tags.

You would need to either remove the second tracker, or give is a name so that you don't end up skewing your data. To name your trackers, you just need to change your go like this:


(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-68630522-1', 'auto', {'name': 'newName'});

And then whenever you need to use this named tracker, you need to append that name to all the GA methods that the object calls:

ga('newName.send', 'pageview');

or

ga('newName.send', 'event', 'blah', 'bluh', 'bleh').
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

View solution in original post

Re: Google Analytics Code Not Tracking

Top Contributor
# 2
Top Contributor
Hi Chanelle G,

There's a few things going on with your tracking:

1. You have GTM installed
2. You have an analytics.js tracker created at the top of the page
3. You have a second analytics.js tracker created in the footer of the page
(You may want to install Tag Assistant to help with verifying the status of your trackers.)

Without naming your analytics.js trackers, you could be skewing your data. It looks like you are sending in two pageview hits to the same property. You should also consider leveraging GTM for your tracking, and having all your on-page code moved over.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: Google Analytics Code Not Tracking

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi,

Thank you for responding. I apologize but what exactly is GTM? Do I need to remove that? Do I also need to remove one of the .js trackers from the header or footer? Also can you provide more info on how you name your trackers?

I also read a lot of bad reviews regarding the Tag Assistant, especially since they upgraded it. Do you recommend any alternative tools?

Thanks!
Marked as Best Answer.
Solution
Accepted by topic author Chanelle G
November 2015

Re: Google Analytics Code Not Tracking

Top Contributor
# 4
Top Contributor
Hi Chanelle,

If you don't know what GTM is, then likely you wouldn't need that on the page. GTM is Google Tag Manager, and it is a tag management system that helps you track events and user interactions into your GA. It embodies the standard features of GA (so whatever you do in GA can also be done in GTM), but GTM has the ability to do things much more conveniently through templated tags.

You would need to either remove the second tracker, or give is a name so that you don't end up skewing your data. To name your trackers, you just need to change your go like this:


(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-68630522-1', 'auto', {'name': 'newName'});

And then whenever you need to use this named tracker, you need to append that name to all the GA methods that the object calls:

ga('newName.send', 'pageview');

or

ga('newName.send', 'event', 'blah', 'bluh', 'bleh').
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: Google Analytics Code Not Tracking

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Hi Nicky Y,

We removed the GA script from our <head> and it is now tracking! Hopefully this does the trick. Thank you so much for your help.