jitsucom / jitsu

Jitsu is an open-source Segment alternative. Fully-scriptable data ingestion engine for modern data teams. Set-up a real-time data pipeline in minutes, not days
https://jitsu.com
MIT License
3.95k stars 277 forks source link

Feature: Enhance Tracking by Storing gclid, fbclid, and UTM Parameters in Cookies and Preventing Non-Search Key Capture #1109

Open robert1112 opened 2 weeks ago

robert1112 commented 2 weeks ago

Current Behavior

  1. Cookie Capture: Currently, Jitsu captures the fbc, fbp, and __ga cookies and places them under “clientIds” in the JSON event data. However, gclid and fbclid are not captured.
  2. UTM Data: UTM data is captured from URL parameters but does not persist after navigating to another page.

Suggested Improvement

1.Storing gclid and fbclid: Store gclid and fbclid in cookies, allowing them to be overwritten if new values are present. Currently, they are only URL parameters and are not stored as cookies in the browser. Jitsu should capture gclid and fbclid from cookies and save them under “clientIds” in the JSON event data. 2.Persisting UTM Data: Capture UTM data from the URL and store it in cookies. Jitsu should read UTM data from these cookies.
3.Preventing Non-Search Key Capture: For WordPress sites, ensure that non-search keys are not captured as search keys. Specifically, the ?s parameter key should be handled correctly.

Reasons for Improvements

  1. Enhanced Audience Matching and Performance Tracking: Storing gclid and fbclid in cookies will improve Google and Facebook audience matching and performance tracking.
  2. Ad Blocker Circumvention: When ad blockers are enabled, the fbc, fbp, and __ga cookies are not generated because Google and Facebook tracking scripts are blocked. However, gclid and fbclid can still be captured from URL parameters, ensuring data is still collected.

Shot 2024-06-18 at 21 49 17 (1)

vklimontovich commented 2 weeks ago

We probably won't store utm_* parameters in cookie. We generally consider polluting cookies as a bad idea, especially considering the fact that cookies are becoming less reliable.

You could always persist utm's by anonymousId key in the store


Speaking of gclid / fbclid. Here's a design we think makes sense here: