8

I setup a Google Analytics account and I setup the website and got the Analytics code which is:

 <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-4XXXXXXX-1', 'mydomain.com');
 ga('send', 'pageview');
 </script>

I pasted into the Header of all my pages but Analytics keeps saying "Tracking Not Installed".

I viewed and verified the source code is within the header of the home page and the code is there. The site is built on Classic ASP (default.asp) and I have several other sites setup in GA and they worked fine. So I don't know why this isn't working. The code above was provided by GA.

Can someone please tell me why this isn't working?

j0k
22.8k28 gold badges81 silver badges90 bronze badges
asked Nov 22, 2013 at 3:49
7
  • In which country are you testing this function? Commented Nov 22, 2013 at 3:54
  • @VickyGonsalves United States on the East Coast. Commented Nov 22, 2013 at 3:55
  • 1
    I hope Google isnt banned there Commented Nov 22, 2013 at 3:56
  • @VickyGonsalves why is that? I have many other accounts that are working find in GA! Commented Nov 22, 2013 at 3:57
  • Try adding another ga code and check in real-time tracking Commented Nov 22, 2013 at 3:58

8 Answers 8

15

Give this a try.

<script>
 var _gaq = _gaq || []; 
 _gaq.push(['_setAccount', 'UA-4XXXXXXX-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.parentNode.insertBefore(ga, s);
 })();
</script>

If you just set this up, you should be able to see analytics in the "Realtime" panel. Many of the other panels can take over a day before analytics are visible.

If you're using Google Chrome, you might also try the tag debugger plugin by ObservePoint or the Official Tag assistant plugin by Google

answered Nov 22, 2013 at 17:18
Sign up to request clarification or add additional context in comments.

1 Comment

A long time after, But this solved the issue for me aswell. Why isn't the original script provided by google work? Why do we need to use a different version (which if I hadn't found here, I wouldn't be able to get the thing to work). Any clues would be nice :)
2

Have you tried using a tool like HTTPFox (firefox) Google's Google Analytics Debugger (chrome) to monitor http requests? This will tell you if it's firing or not. If it is, check the real-time reports as mentioned in the comments. If it's not, then it's an issue with the code or your page.

answered Nov 22, 2013 at 16:44

Comments

1

I figured out what the problem was. I setup an Account with GA using there new Beta Feature and I guess the account wouldn't work with the code they gave me. So I deleted that account and recreated a Classic Account and took the code I posted above and it worked fine. Thank you all for your help!!

answered Nov 22, 2013 at 20:35

Comments

1

New Analytics Means New APIs

You are using the "Universal Analytics" snippet which is Google's new system they are trying to transition everyone over to. Some of the APIs have changed including event tracking.

Make sure you are using this:

ga('send', 'event', category, action, label);

Instead of this:

_gaq.push(['_trackEvent', category, action, label]);

For event tracking. Here is a thorough blog post on the subject http://blog.tylerbuchea.com/tracking-events-in-googles-new-universal-analytics/

answered Jun 2, 2015 at 19:36

Comments

0

I had a similar issue, I was hitting the wrong url, so I am redirecting somedomain.com to www.somedomain.com

see: https://support.google.com/tagmanager/answer/6103683?vid=1-635771588228302150-2080886913&rd=1

Make sure that you have published your tag, and that your trigger is formed properly to allow it to fire on the page you are testing. Note that it can take a few seconds for the container to publish, and that you should do a hard refresh (e.g. ctrl+F5) of the page to see the changes.

Check that your trigger isn't unnecessarily specific. For example, if you define a URL based trigger and begin the URL with "http://www.example.com", the tag will not fire for URLs "https://www.example.com" (using "https") and "http://example.com" (without the "www").

Google Tag Manager can only fire tags within the capabilities of the browser. Most browsers will not open more than six to eight HTTP requests to a single domain at a time. If you have a high number of tags on the same domain firing under the same conditions, tags will only fire within this browser limitation.

answered Sep 6, 2015 at 18:38

Comments

0

Just ran into a new version of the "not tracking" issue.

Apparently now with the new Google Site Tag (gtag.js) tracking code, Analytics will only start tracking if you're signed up to Google Tag Manager as well and enable the domain there.

My new Analytics property didn't track for half a day after I added the tracking code. After enabling the domain in Google Tag Manager, it started tracking instantly.

I think this is probably a bug. Hopefully they will fix.

answered Oct 8, 2017 at 17:59

Comments

0

I found out in my case that my content blocker (Wipr on Safari) was blocking the tracking request. Disabling the content blocker fixed this.

answered Oct 10, 2017 at 23:16

Comments

-1

add a type="text/javascript" to your code

 <script type="text/javascript" >
 (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-XXXXXXXX-X', 'auto');
 ga('send', 'pageview');
</script>
answered Oct 5, 2014 at 11:24

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.