../courses.php
Google's Role In The Web
GOOGLE
90
Google Analytics And Visitor Tracking
Why a page's visit counter and its actual number of human visitors can genuinely disagree.
A website owner checks Google Analytics and sees a healthy, steady number of page views every single day for a particular page. The owner later discovers that page has been broken, showing nothing but an error, for an entire week. The reported page views never dropped at all during that week. How could a broken page that shows nothing keep generating page views?
Google Analytics records a page view specifically when its own tracking code, embedded in that page, successfully runs in a visitor's browser, not based on whether the page's main content actually displayed correctly. If the broken page still loaded enough of its surrounding structure for the analytics tracking script to execute, each visit still counted as a page view in Analytics, completely independent of whether the actual content a visitor came for was showing anything at all.
Google Analytics works by embedding a small piece of tracking code into a page, which runs in a visitor's browser and sends information about that visit back to Google's analytics servers.
A page view is recorded specifically when this tracking code successfully executes, which depends on the tracking code itself loading and running, not on whether the rest of the page's intended content displayed correctly.
Analytics data reflects only visits where this tracking code actually ran. A visitor whose browser blocks the tracking script entirely, through certain privacy settings or extensions, can visit a page with that visit never being recorded at all.
Analytics reports commonly include various measurements beyond simple page view counts, such as how long visitors stayed, what they clicked, and where they came from, each one its own separate kind of recorded event.
Analytics data belongs to, and is controlled by, whoever set up that Google Analytics account for the site, not to Google directly for its own separate purposes. This is a service the site owner uses, with its own separate privacy implications for visitors worth being aware of.
What the tracking code actually does, separate from the page's real content
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
gtag( 'config', 'G-XXXXXXX' );
</script>
<!-- below this point, the page's actual content,
which may or may not have loaded correctly -->
The script tag loading the tracking library loads Google's own analytics code from Google's servers. This step succeeding has nothing to do with whether anything below it on the page works correctly.
The gtag( "config", ... ) call is what actually records this visit as a page view, the moment it successfully runs. This happens regardless of what the rest of the page's HTML, further down, actually contains or whether it loaded at all.
Everything below the marker comment is the actual reason a visitor came to the page. This lecture's opening question describes exactly the situation where everything above this comment works fine while everything below it is broken.
Tracking code placed early in a page's HTML, before the rest of the content, is more likely to successfully run even if something further down the page fails to load correctly, which is part of why this specific failure pattern, counted views on a broken page, can happen at all.
A steady page view count alone says nothing about whether visitors are actually seeing and using the page's real content. That requires checking the actual page directly, not only its recorded analytics.
A recorded page view confirms the tracking code ran, not that the page worked
Page view counts measure one specific, narrow thing, successful execution of the tracking code, which can remain completely healthy even while the actual content a visitor came for is entirely broken, exactly as in this lecture's opening scenario.
Analytics blocked by a visitor's own settings creates an undercount, not an error
A visitor whose browser or extension blocks Google's tracking script entirely produces no error visible anywhere in analytics. That visit simply never gets recorded, which means real analytics numbers are commonly an undercount of true visits, by an amount that varies depending on how many visitors use blocking tools.
Different recorded metrics measure genuinely different things
Page views, time on page, and click events are separate measurements, each requiring its own specific tracking to succeed. A tracking setup that successfully records page views can still be entirely missing data on a different metric it was never actually configured to capture.
Tracking code placement affects how reliably it captures a visit before something else fails
Code placed early in a page is more likely to run successfully even if a later part of the page breaks, which is a deliberate, practical reason for placing tracking code near the top, separate from any broader question of whether early placement might slightly affect a page's own loading speed.
Analytics data alone cannot confirm a page is actually working for visitors
A steady or even growing page view count provides no direct confirmation that visitors are successfully seeing and using a page's real content, which is why analytics needs to be paired with actually checking the page itself, not relied on as the sole signal that everything is working.
Trusting steady page views as proof the page works
page views: healthy and steady all week
actual page: broken, showing only an error, for the entire week
Checking the actual page alongside its analytics
page views: healthy and steady all week
actual page: checked directly, confirmed working correctly
When an AI tool interprets analytics data, three things are worth checking. First, does it treat a recorded page view as confirmation only that tracking code ran, not that the page's actual content displayed correctly. Second, does it account for visits blocked by a visitor's own privacy settings as a source of undercounting, rather than treating analytics numbers as a complete, exact count. Third, does it recommend checking a page directly, rather than relying on analytics alone, to confirm it is actually working.
Check a real page's analytics setup, and identify exactly where in the page's HTML the tracking code is placed.
Explain, in your own words, why a page showing only an error message could still record a normal page view.
Research how browser privacy settings or extensions can prevent analytics tracking code from running, and explain what this does to recorded numbers.
Describe a realistic monitoring practice that would have caught the broken page in this lecture's opening scenario, despite steady page view counts.
Identify three different metrics analytics commonly records beyond simple page views, and explain what each one actually measures.
Trusting steady or healthy page view counts as proof a page's actual content is working correctly.
Treating analytics numbers as a complete, exact count of every visit, without accounting for visits blocked by privacy tools.
Assuming all analytics metrics, page views, time on page, clicks, measure the same underlying thing.
Relying on analytics data alone, with no direct, periodic check of the actual page itself.
Placing tracking code in a position on the page where it is unlikely to run before something else on the page fails.
You can now explain why a recorded page view confirms only that tracking code successfully ran, not that a page's actual content displayed correctly. You can also account for visits blocked by privacy tools as a source of undercounting, and explain why analytics data needs to be paired with directly checking a page, not relied on as the sole signal that it works.
Login - Jit4All
Login
Welcome back to Jit4All