Analytics implementation · Verified test events
From portfolio interactions to verified analytics.
I defined a small measurement plan, added optional GA4 tracking to an Astro portfolio, and checked that test interactions reached Google Analytics with useful event details.
Verification recorded October 15, 2026 (America/New_York).
The problem
The portfolio presented projects and recruiter contact links, but had no analytics integration to show which pages were visited or where visitors clicked the résumé, email, and LinkedIn links. The first goal was to establish trustworthy collection before interpreting visitor behavior.
Measurement decisions
- Project visits: page_view records page loads, with a project_id on five mapped project pages. A visit to the Projects listing is distinct from viewing an individual project.
- Résumé interest: resume_click records activation of the public PDF link, not proof of a completed download or reading.
- Contact interest: contact_click and linkedin_click record link activation, not a sent email, connection, or hiring outcome.
I used fixed event labels and source-page paths to keep the implementation focused. Google’s enhanced measurement is required to be disabled in the property to avoid overlapping tracking; that account setting is not shown in the evidence below.
Implementation and checks
The shared Astro layout loads a small tracking script. It requests Google’s library only after a visitor allows analytics and only on the production hostname. Rendering-test fixtures are excluded. Visitors can change their choice through analytics preferences.
Custom click parameters contain fixed labels rather than email addresses or form contents. Configured page URLs omit query strings and fragments, and referrers are reduced to their origin. These are implementation choices, not a claim of a comprehensive privacy audit.
Automated checks cover consent gating, excluded hosts and fixtures, one explicit page-view command per document load, click classification, URL sanitization, debug scope, and withdrawal handling. Generated-page checks also verify the tracking script’s inclusion and exclusion.
I used AI-assisted coding to implement and test the integration, created the GA4 property, and performed the live verification interactions. The source, test scope, and observed results are available for inspection.
Observed results
During a controlled test session, GA4 Realtime showed two page views and one each of resume_click, contact_click, and linkedin_click. The page titles identified Contact and Projects. A later DebugView screenshot showed a page_view with project_id set to discoverability-foundation.
What this demonstrates
Measurement planning, JavaScript event instrumentation, consent-aware implementation, automated QA, and live analytics validation. The outcome is a working collection foundation with evidence of event receipt.
The screenshots do not establish organic traffic, conversion improvement, all project mappings, every event parameter, or successful delivery on every browser. Production checks for no requests before consent and after withdrawal remain undocumented, as does browser visual QA. Local command tests do not replace those checks.