Deepu S Nath
Deepu S Nath

Reputation: 1184

Google Analytics, Page views are not tracking correctly

I have installed the below google tracking code in my site

var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
  _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);
  })();

In my GA account under visitors -> page views are not showing correctly. After many visits to the site it is showing only page views as 2. The total number of page views doesn't seems correct. Is there any problem in my tracking code. Please give me a solution on this.

The Code is placed just before the </body> closing tag as it was recommented as best practice of placing analytics code. We placed the code in all pages and the status in GA is "Receiving Data". It is a video sharing website where we also use Google Analytics Plugin of JW Player. Following is a url to a site page storybridge.tv/StoryBridge/freespirits/story/fightclub

I also checked and confirmed that there is no other script that use the variables _gat and _gaq.

Upvotes: 0

Views: 2740

Answers (1)

user757428
user757428

Reputation:

Make sure that other scripts on your pages do not use the variables _gat and _gaq, since those are global variables used by the asynchronous tracking code. As long as those variables are not used by other scripts on your pages, there should be no other interference with the tracking code from your own scripts.

Upvotes: 2

Related Questions