docs: send primary conversion events to the first-party conversion worker#8752
Open
pubkey wants to merge 1 commit into
Open
docs: send primary conversion events to the first-party conversion worker#8752pubkey wants to merge 1 commit into
pubkey wants to merge 1 commit into
Conversation
…rker Captures the Google Ads click id (gclid/wbraid/gbraid) on landing and stores it for 90 days. The six primary conversion events (dev_mode_tracking_iframe, console-log-click, premium_lead, request-demo-sub, copy_on_page, visit_x_urls) are additionally sent via sendBeacon to the rxdb-events Cloudflare worker, which Google Ads pulls as offline conversions so ad blockers cannot prevent conversion tracking. When gtag is blocked, a client id is attached so the worker forwards the event to the GA4 Measurement Protocol; users with working gtag are excluded from that path to prevent double counting. Also corrects the revisit_3_days comment (self-triggering conversions must not be primary). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EPJvU6oisC97X9uzc1qfGC
4e774a4 to
0ee4dd5
Compare
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.
This PR contains:
Describe the problem you have without this PR
Roughly half of the developer audience blocks
gtag/Google Analytics, so Google Ads conversion tracking silently loses those users, and there is no way to attribute conversions back to ad clicks (no click-id capture existed). This PR wires the docs site to the first-partyrxdb-eventsCloudflare worker:gclid(or iOSwbraid/gbraid) URL parameter is validated and stored inlocalStoragefor 90 days (the Google Ads click-through window).dev_mode_tracking_iframe,console-log-click,premium_lead,request-demo-sub,copy_on_page,visit_x_urls) are additionally sent viasendBeaconto the worker when a click id is stored. The worker stores them and Google Ads pulls them daily as offline conversions, so ad blockers cannot prevent conversion measurement. The set is declared explicitly inGOOGLE_ADS_PRIMARY_EVENTS(mirroring the existing Reddit primary-event pattern).gtagis blocked, a (self-minted or_ga-derived) client id is attached so the worker forwards the event to GA4 for counting. Users with workinggtagnever take this path, preventing double counting.triggerTrackingEvent()after the existing per-user frequency capping, so caps apply equally to all trackers.revisit_3_days: it must stay observation-only because it fires on the return visit itself (a second ad click would generate and get credited for its own conversion).Tracking code never throws (all storage/beacon access is wrapped) and stays inert on localhost/dev since the worker only accepts the
https://rxdb.infoorigin for browser requests.Todos
🤖 Generated with Claude Code
https://claude.ai/code/session_01EPJvU6oisC97X9uzc1qfGC
Generated by Claude Code