Page counter and Google Analytics show different page visits - google-analytics

I have enabled a hit page counter in my website (www.ludhianaweddings.com) to count daily visits. Its an Update SQL query on each and every page that is updated by 1 each time any page is visited. I am also using Google analytics to overview my site. Now i am getting different results in both. For me Hit page counter always show more visits than Google analytics. For example from last three days my hit counter visits are 319, 411, 379. While Google analytics showing 199, 266, 234 in its reports.
I have put my update query on top of the page and Google analytics code after closing body tag. Is it can be a reason for that ??
Sorry to those who will say it off topic as i had no other better option to ask this from expert(s).
Please help me out...Thanks in advance

I doubt that you will ever get your Hit counter to match 100% with Google analytics. There are a lot of things that can cause Google analytics to not log a hit. The first being the user not having JavaScript enabled the second being possibly ad blocker.
There are also referral spam bots which will insert random hits into your Google analytics account directly and bypass your website 100%. In that case your Google analytics will record higher numbers then your hit counter.
It also depends on what metrics you are looking at:
ga:sessions The total number of sessions.
ga:users The total number of users for the requested time period.
ga:pageviews The total number of pageviews for the property.
These are all different numbers and may have different results depending upon how you look at them.

This seems at least vaguely code related, so, not off-topic.
Placing JavaScript code after the closing body tag is technically wrong, although in most cases it will still work.
If anything you would put it before the closing body tag. Even that would not give you the optimum result, as this would not count users that have aborted the loading process before the page was finished.
But at the end of the day Javascript-based tracking will always give you less visits then a serverside solution. Many bots do not execute JavaScript, people can opt-out from tracking and some adblockers block Analytics tags from working. Not really much you can do about it, except trying to figure out if the sample you are catching with javascript tracking is still big enough to allow conclusions based on it (for the moment I'd say yes, usually it is).

Related

Unusual amount of pageviews in GA4 - result of headless web?

I manage the analytics of a website that uses a headless web, and have noticed an unusual amount of page_view events one some of the pages.
Perhaps it could have something to do with the website being headless, meaning that the URL doesn't change/refresh when clicking, even though the content on the site is changed as if it was a url redirect.
does this make sense? Anyone got any good suggestions on why my events might be off?
My first thought was that the event tracking configuration wasn't set up correctly, resulting in multiple pageviews on the wrong pages (i.e. first page visit → 2nd page → 3rd page = three pageview fires on first page), but upon investigation this doesn't seem to be the problem.
Checked for bot traffic and it doesn't seem to be that, as we're also tracking through UA and Matomo and those numbers look way more likely.
First, what you've described is not necessarily a headless website, it's just a misconfigured Single Page Application that doesn't care about updating the url. A Huge SEO issue, but not a blocker for Analytics. And when an SPA affects analytics, it's most commonly less events, not more.
If the bot traffic inflates one analytics system as a side-effect of whatever it does, it will inflate similarly pretty much any other analytics system, so if numbers in UA and Matomo look alike, it doesn't rule out bots. Especially if your GTM sends events to both systems on the same triggers.
Now, there are ways to debug it besides just going to the website and looking at a few pages tracking.
In cases like this, you want to use data to debug your tracking.
You build a report (custom report, or just use pregenerated UA reports) in which you compare the anomalous traffic period to the previous period so that you would have your base. Now, whatever dimension you're using, you're looking at the value or a few values of this dimension that contain most of the anomalous traffic. This is to see if any dimension contains the outlier that would explain the nature of the anomaly.
Dimensions that I would look at right away are: hostname, country, hour of the day, source, page, landing page, exit page, referrer. I would also take a quick look at all the conversion numbers, bounce rate and avg time on site.
If all of these look organic, then I would presume natural growth of good traffic.

Google Tag Manager - Tag Firing Way too Many Times

We are having an issue with our tracking on www.x3tradesmen.com where a Google Tag Manager tag is firing way too many times and we cannot determine why...
We only have one website event tag linked to Google Analytics called Form Submit and typically we would receive between 2-10 Form Submit events per day at the most, however, recently we have noticed that the tag is firing 1000's of times sporadically and we cannot pinpoint the issue. We have also noticed that our users have drastically increased for short time periods (minutes/hours). We typically only get 40-80 users per day on our website but we saw a massive spike of around 400 users in less than one hour once.
We recently added the facebook pixel via GTM and that is really the only change that we have made and now we are seeing these issues. Does anyone know of any common reasons to why this would be behaving this way or can anyone see any major issues with our implementation of GA or GTM on our website that would cause this?
I know this information is vague, so please let me know if there is specific information that would help identify the issue.
Thanks in advance!
Screenshot 1
Screenshot 2
Screenshot 3
Screenshot 4
Screenshot 5
I presume it is the FB pixel - Facebook automatically collects information in addition to what you have configured yourself and uses post/submit events to send them. You can disable that behaviour as per documentation and see if it makes a difference:
Automatic Configuration
The Facebook pixel will send button click and
page metadata (such as data structured according to Opengraph or
Schema.org formats) from your website to improve your ads delivery and
measurement and automate your pixel setup. To configure the Facebook
Pixel to not send this additional information, in the Facebook Pixel
Base code, add fbq('set', 'autoConfig', 'false', '')
above the init call.
I had a similar issue where suddenly additional submit events turned up in the GTM preview pane that I finally tracked down to FB, so there is a good chance that yours is the same problem.

why track email opens as events and not as pageviews

Since a while I've been playing around with the Analytics Measurement Protocol, and also used it in some test emails as described in this article:
https://developers.google.com/analytics/devguides/collection/protocol/v1/email
But what puzzles me is that Google recommends to track email views as events, not as page views.
From one side I can see the point, but on the other hand in Google Analytics I get an alert stating that I have events without page views.
Can anyone answer me why it should be done that way, or what arguments are there that speak for it? Otherwise I could also just use the Measurement Protocol to send a page view.
I do not know why Google recommends this, but I rather suspect it's because you will skew some of your metrics if you use pageviews - an opened e-mail would count as a bounce, which in turn would bring down average time on site, pages per session etc. If you make opened e-Mail an event you can avoid this.

Google Analytics reporting data before tag is even up

So I've been working on a website for a while. GA account has been up for a couple months but I waited for the website to be finished before putting up the actual JS tag.
In the meantime, the website is being HTTP password restricted (basic authentication) so it isn't even accessible unless you know the user/pwd combination.
To my surprise, I realized today that GA has logged several hundred views to the root of my website. Paths are mostly things like:
/
/?from=http://social-widget.xyz/
/?from=http://www.traffic2cash.xyz/
Bounce% and exit% both at 100% for all of them.
I realize this looks like referral spam, and there are ways to prevent it. Came across this upon googling:
http://botcrawl.com/block-social-widget-xyz-referral-spam-in-google-analytics/
My question is: how can GA log anything anyway when no tag is up and the website isn't even accessible?
Thank you very much in advance
Because it's spam. They hit Google Analytics directly with random GA codes and don't even go through your website.
GA can't tell if these are real hits (from website visits) or fake hits (from spam bots who hit GA directly calling the same ode as they would if on the website). Though arguably they should do more about this.
Massively annoying - particularly when first starting out as this can be a heavy proportion of your "traffic".
It's easy to set up a filter rule is to catch a lot of this by filtering on hostname. As they are randomly hitting GA and don't even know what website they are hitting GA for, they don't usually set this correctly. Real traffic should only come from yourwebsitedomain.com so add a filter for that.
STRONG piece of advice: abandon the default UA-########-1 tracking code of your new website -- simply do not use it!
Create a second and third property on the Admin screen, then use the tracking code for the third property. You will immediately see a lot less spam. No filters or segments necessary!
If you want the whole sad story about spam visits in GA, I have been maintaining the Definitive Guide article for over a year now:
http://help.analyticsedge.com/spam-filter/definitive-guide-to-removing-google-analytics-spam/

Image impressions vrs Google Analytics

can any help?
Currently I have page with an image loading. Every time the image loads I write to a database:
Count = Count +1
I have tested my code by refreshing my page and the image count works correctly (going up by one each time).
Currently the count for this month is over 60,000, however in Google Analytics on that page it shows the pageview as 1800 and the unique pageview even less.
Has anyone any idea why the numbers are so far apart from my count and Google pageview.
How does Google calculate it's pageviews? Are spiders the issue?
Thanks
Google Analytics records data using an image request sent via Javascript -- meaning most bots/spiders won't show up.
I'd suggest taking at look at your server logs. Each image request you're tracking should have a corresponding page request. Maybe your image is being hotlinked?

Resources