Reputation: 4472
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:
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.
Am I missing anything in my script or settings that I should have enabled?
Thank you!!
Upvotes: 4
Views: 4112
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,
Upvotes: 0
Reputation: 1744
I usually check the following:
-- please leave a comment if you want to add s.th. to the list
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
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