Tigerjz32
Tigerjz32

Reputation: 4472

Why is Google Analytics not showing data but shows property hits?

I recently setup Google Analytics on my website, hosted on a VPS I manage. This is a plain HTML webpage, not a CMS like Wordpress (not sure if that matters?) I copied and pasted the following right above the </head> tag.

<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-########-#', 'auto');
  ga('send', 'pageview');

</script>

When I login to Google Analytics I see values in Property Hit Volume:

enter image description here

Despite these hits, there is no data in Audience Overview or anywhere else in the portal. I created a View with default settings from Property Settings, so there are no filters in place.

enter image description here

Am I missing anything in my script or settings that I should have enabled?

Thank you!!

Upvotes: 4

Views: 4112

Answers (3)

George Inggs
George Inggs

Reputation: 270

Another thing to check, which I've just come across, is that you don't have any forgotten filters which might be stopping traffic from showing up. In our case, someone had added an exclude filter months earlier that stripped all traffic to the www subdomain (possibly an effort to stop spam). This was working OK until we moved web hosts and all traffic started being redirected to a new www subdomain, but obviously we had forgotten to turn off the filter.

In our case, the Google Tag Assistant was all good, we could see the hits in the Admin console, but there was just no data in the views. As soon as we removed the filter, the hits started reflecting immediately in our views.

To get to the Filters,

  1. Log into your Analytics account
  2. Click on the Admin menu item
  3. Click the All Filters submenu
  4. Check your list of filters for the property, particularly those with an Exclude type and delete any that might be stopping traffic in your views.

Upvotes: 0

Hafenkranich
Hafenkranich

Reputation: 1744

I usually check the following:

-- please leave a comment if you want to add s.th. to the list

  • UA-########-# is set correctly
  • JavaScript is enabled
  • no adBlockers enabled
  • tried a different browser (just for test purposes)
  • no errors in console (browser console, developer tools)
  • created some hits (reload the page a few times)
  • waited a few hours (and then create a few more hits)
  • hostname has to be the same as URL

If nothing else helps, create a minimal page test case:

<html>

<head>
  <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-########-#', 'auto');
    console.log('-- ga send before --');
    ga('send', 'pageview');
    console.log('-- ga send --');
  </script>
</head>

<body>
  <h1>analytics test</h1>
  <p>check console output</p>
</body>

Upvotes: 3

VERB Interactive
VERB Interactive

Reputation: 216

It depends on when you created the view. Views will only accumulate data from when they are created. So that might be a reason as to why you are not seeing any traffic on the reporting side.

The easiest way to test if the tracking code implementation works is to go to the website and then check the real-time view in Google Analytics. If you cannot see yourself there, you have issues with the tracking code.

Upvotes: 3

Related Questions