大网数据广告活动
网站运营与故障问答

Google Analytics not same with my database records

· 52CE 我爱测

I got a website which will track all the post's visitor view and store each of them in a table with IP address, referrer website and user agent. But I found that in one day I got 100+ rows (pageviews) in my database table, but Go…

问题原文

原帖链接 · Ping · CC BY-SA 3.0

I got a website which will track all the post's visitor view and store each of them in a table with IP address, referrer website and user agent. But I found that in one day I got 100+ rows (pageviews) in my database table, but Google Analytics showed that it has only around 40 pageviews that day.

Besides, when I found out my database got a new row and I went to see the Real-Time report in Google Analytics, it shows that my website got 0 visitors in the past 30 minutes.

I did tried accessed my website using my own phone and computer, both database and Google Analytics will record my view, anyone know why?

已采纳解答

原帖链接 · Chris Rutherfurd · CC BY-SA 3.0

There are a number of reasons why Google Analytics may not be showing the traffic your database shows...

Your Code Is Positioned Poorly

Your GA tracking code should be in the head section of the document, some webmasters put it in the bottom to improve load times however this can sometimes mean that the user has come to your site and then bounced right back out before GA has finished loading. (https://support.google.com/analytics/answer/1008080)

User Has Javascript Disabled

GA depends on javascript to run. Some users have javascript switched off in their browsers for security reasons. Most web crawlers don't process javascript either and so a crawler won't show up in GA while your server logs and database log will show the traffic from the crawler.

User Has Opted Out of Analytics

Google provides a browser add-on to opt out of Google Analytics. When this add-on is detected GA will not log any details about the browser and as far as your GA report the user never connected. (https://support.google.com/analytics/answer/181881?hl=en)

High Volume

In some instances where GA data is consistently off base with your own analytics it can indicate that Google has decided to start sampling your data instead of showing all of your data. This is generally due to a high amount of traffic but I have been unable to find any details on the Google support page (https://support.google.com/analytics/answer/2637192?hl=en) about what sort of traffic limits there are before sampling comes into place. The only way to avoid this is to use another analytics provider as it is forced into GA free to limit excessive loads on the GA network.

As you can see there are a number of reasons why Google Analytics will not show all the records your database or server analytics do and these aren't all the reasons, just the most common. You will probably find that the large discrepancy is to do with multiple issues some of which will be in this list. As a side note the only one of these issues that can be fixed is the code position, the other issues can't be fixed.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。