Repository navigation
feat(analytics): QA visits → traffic_type=internal (reuse Tacko isQaVisit) - #895
Merged
Merged
Conversation
…isable, consent denied, clear _ga)
… page_title after route title update
…fix/ga-qa-traffic-type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base branch:
fix/ga-consent-withdrawal(stacked on #894 → #893; all touchGoogleAnalytics.tsx).Summary
P1 from the Phase 1 analytics audit: TT had no QA/internal tagging, so audit and agent probe hits counted as real traffic.
lib/qa-visit.tsports Tacko'sisQaVisitlogic:?qa=1,utm_source=qa/qa_*, or aTackoQAUA → setqa=1cookie (30 days,Path=/,SameSite=Lax,Secureon https,Domain=.telemetry-tracker.comon the hosted site) + sessionStorage; an existingqa=1/tacko_qa=1cookie also counts.GoogleAnalytics.tsx:traffic_type: 'internal'ongtag('config')and on every explicitpage_viewfor QA visits. Only evaluated after Accept (the helper runs only inside the consented GA code path).qacookie;/cookiestable lists theqacookie.How to test
pnpm lint✅; dashboardvitest✅ 76 files / 457 tests (newlib/qa-visit.test.ts+ GoogleAnalytics QA case);next build✅./collectintercepted locally): landing, Link nav and back hits all carrytt=internal; after withdrawal cookies[], 0 hits.GA4 admin (not code):
traffic_typemust be registered/used by the Internal Traffic data filter (set to Active) in property 544138170 for these hits to be excluded.Checklist
Security / privacy
One new first-party marker cookie, only for QA links and only after consent; disclosed in the cookie policy; removed on withdrawal.