Question

I have my own PHP script that run page view counter, where every visit will automatically add to the current data without any condition. But when I checked out my Google Analytic its display differently, it is lower than my page view counter. Is there any condition in GA before it add the analytic to data? How page views work in GA?

Was it helpful?

Solution

I assume you use the standard GA Javascript tracker. People may opt out from being tracked, the javascript might be blocked by browser extensions/adblocking scripts, and presumably your site is visited by search engine crawlers and other bot traffic that does not execute the javascript but will be included in your homegrown tracker. So it's expected behaviour that javascript-based tracking and serverside tracking do not match (by now you can build a serverside tracker with Google Analytics using the measurement protocol - it would be interesting to see if that would result in a closer match).

A session is the time a user interacts with the page (if he has simply opened the page without clicking anything the session will expire by default after 30 minutes). So for all practical purposes a session is the same as a visit ("session" is a term that refers to a technical process, visit is what you would use in reporting). A visit can include a number of pageviews, events, e-commerce-transactions and other interactions. For practical reasons Google Analytics does not record more than 500 interactions (pageview, transaction etc.) per session/visits.

During a session/visit might look at a page more than one time. This will be recorded "raw" as pageview, but will be deduplicated to give you a "unique pageview" number that show the number of distinct pageviews without duplicates.

Similar happens with the visits/unique visitors number. Some people might have multiple sessions/visits. Google Analytics will recognize returning visitors by a unique id that by default is stored in a cookie. So the "visits" number would be the raw number of visits, unique visitors would include every visitors just once.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top