How Attribution Works
The Attribution ID (cr_attrib)
Every visitor gets a unique cr_attrib UUID when they arrive on your site. This ID follows them through the entire funnel:
- Page visit — The attribution script generates and stores
cr_attribin a cookie and localStorage - CTA view — The script detects when a CTA enters the viewport (50% visible) and records a
cta_viewevent - CTA click — The script captures clicks on CTA elements and records a
cta_clickevent - Link rewrite — The script appends
cr_attribas a URL parameter on the CTA’s destination link - Form submission — HighLevel captures
cr_attribfrom the URL or injected hidden field - Webhook — HighLevel sends the form submission (including
cr_attrib) back to WisePilot - Join — WisePilot links the form submission to the original CTA click, content asset, and visitor session
The Attribution Script
The script (attribution-tracker.js v3.0) is bundled in the WisePilot WordPress plugin and handles:
- Generating and persisting the
cr_attribcookie (90-day expiry) - Rewriting CTA links to append
cr_attriband UTM parameters (idempotent) - Tracking CTA views via IntersectionObserver (50% visibility threshold, fires once per element)
- Tracking CTA clicks via event delegation (capture phase)
- Posting events directly to the WisePilot API via
navigator.sendBeacon()withfetch()fallback - Batching view events (1-second debounce, up to 50 per batch)
- Flushing events on page unload (
visibilitychange/pagehide) - Injecting
cr_attribinto GHL inline forms and iframe forms - Firing GA4 custom events (
cta_view,cta_click) ifwindow.gtagis available
Event Delivery
Events are posted directly toPOST /api/integrations/cr/events — no GTM middleman. The request is authenticated by a per-site tracking_token (auto-generated when you download the plugin).
source_event_id.
GA4 Dual-Write
If GA4 is installed on your site (i.e.,window.gtag exists), the attribution script automatically fires cta_view and cta_click as GA4 custom events. No configuration needed — if gtag is on the page, events fire. You’ll see them in GA4 DebugView and reports.
What Gets Linked
Once attribution is working, WisePilot can tell you:| Question | Data Source |
|---|---|
| Which content asset did this lead see? | page_path + asset resolution |
| Which CTA did they click? | cta_id + cta_position |
| Where did the form submission originate? | cr_attrib link to CTA click |
| What was the conversion path? | Full session: view -> click -> submit |
| Did they book? | GHL contact -> conversation -> appointment |
The Full Funnel
The attribution funnel joins data from multiple sources:Privacy
Attribution operates with configurable privacy modes:- Strict (default) — Nulls referrer and click IDs immediately after join
- Standard — Retains data with retention caps
- Debug — Full data retention, auto-expires after 7 days