Dedup click-ID capture + record capture timestamp - #134
Conversation
Store a single click identifier (priority gclid > wbraid > gbraid, capped at 512 chars) plus a photon_ads_click_captured_at cookie. A reload of the same click no longer refreshes its 90-day window; a genuinely new click replaces prior attribution and resets the timestamp. Includes a migration path that backfills the timestamp for cookies set by the previous script.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🔇 Additional comments (4)
📝 WalkthroughWalkthroughThe script now validates supported click identifiers, manages attribution cookies through shared helpers, preserves same-click attribution, migrates missing timestamps, removes stale identifiers, and replaces attribution for new clicks. ChangesClick attribution tracking
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to This change deduplicates click-ID attribution and records its original capture time without introducing any actionable merge-blocking risk; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Browser
participant ClickIdTracking
participant CookieStore
Browser->>ClickIdTracking: provide URL click parameters
ClickIdTracking->>CookieStore: read existing attribution cookies
ClickIdTracking->>CookieStore: preserve or replace attribution state
CookieStore-->>ClickIdTracking: return updated cookie state
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Follow-up to #133 (merged). Upgrades
click-id-tracking.jsfrom "store every click id present" to a deduplicated, single-identifier capture with a timestamp.Behavior
gclid>wbraid>gbraid, capped at 512 chars — plus aphoton_ads_click_captured_atcookie.captured_atfor cookies written by the previous version of the script.Domain=photon.codesso it's shared across the apex domain.Verification
Ran the actual script against a simulated cookie jar across 8 scenarios — all pass:
?gclid=…)captured_atcaptured_atpreserved (no refresh)?wbraid=…)captured_ata/b c+d)Note: implementation uses top-level
return, so it's wrapped in an IIFE; formatted to the repo's antfu ESLint style (pre-commit lint/generate/typecheck pass).Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit