Docs: document Campaigns analytics context#32
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
developer-docs | b8a783a | Commit Preview URL Branch Preview URL |
Jul 21 2026, 10:07 AM |
|
|
||
| ## Campaign and Journey Context | ||
|
|
||
| RudderStack events include the campaign context provided by the SDK using the original snake_case field names: |
There was a problem hiding this comment.
WARNING: Misleading framing — the intro promises "campaign context ... using the original snake_case field names", but the table that follows also lists page_type and page_name, which are page-context fields, not campaign fields. Either move page-context fields into a separate sub-section or rewrite the intro to describe the full scope (campaign + page + journey IDs).
|
|
||
| | Field | Description | | ||
| | --- | --- | | ||
| | `campaign_id` | Campaign ID | |
There was a problem hiding this comment.
SUGGESTION: The descriptions for campaign_id/campaign_name/campaign_currency/campaign_language/campaign_session_id are tautological — they just restate the field name ("Campaign ID", "Campaign name", etc.). The index.mdx table gives richer descriptions (e.g. "Campaign ID returned by the Campaigns API"). Align these so the same field reads consistently across the two docs.
| | `page_type` | Current funnel page type | | ||
| | `page_name` | Current funnel page name | | ||
|
|
||
| The adapter also uses the SDK session ID to connect events across the funnel: |
There was a problem hiding this comment.
WARNING: Sentence claims "the adapter also uses the SDK session ID to connect events across the funnel", but none of the three bullets that follow mention a session ID — they describe cart_id, checkout_id, coupon, and discount, which are object/cart correlation IDs, not session IDs. Either move the session-ID bullet up (e.g. add one explaining campaign_session_id correlation) or rewrite the lead-in to match the actual content (cart/checkout/coupon correlation).
| campaign_name: 'Summer Campaign', | ||
| campaign_currency: 'USD', | ||
| campaign_language: 'en', | ||
| campaign_session_id: 'ncsid_abc123', |
There was a problem hiding this comment.
WARNING: This example payload contains two different session IDs with two different prefixes (campaign_session_id: 'ncsid_abc123' here, vs _metadata.session_id: 'sess_abc123' later in the same block) but doesn't explain how they relate or which one a downstream consumer should treat as canonical for funnel/session analytics. Add a one-line note clarifying the distinction (e.g. campaign session vs SDK internal event session) so readers don't double-count sessions.
| | `campaign_name` | Campaign name | | ||
| | `campaign_currency` | Campaign currency | | ||
| | `campaign_language` | Campaign language | | ||
| | `campaign_session_id` | Session ID from the Campaigns session-tracking cookie | |
There was a problem hiding this comment.
SUGGESTION: "Session ID from the Campaigns session-tracking cookie" doesn't name the actual cookie, so readers can't inspect, clear, or configure it. Either name the cookie (the api/index.mdx page references a session-tracking snippet — link there) or replace the parenthetical with a link to the session-tracking documentation.
| | `campaign_language` | Campaign language | | ||
| | `campaign_session_id` | Session ID from the Campaigns session-tracking cookie | | ||
|
|
||
| Configure the campaign API key before the SDK loads so the SDK can retrieve the campaign record and populate these fields. |
There was a problem hiding this comment.
WARNING: "Configure the campaign API key before the SDK loads" gives no link, no example, and no failure-mode description. Readers will hit this and not know (a) where to set the key, (b) what config key name to use (window.nextConfig.apiKey?), or (c) what happens if the key is missing or set after load — do events still fire with campaign_* fields as undefined, get dropped, or log a warning? Link to /docs/campaigns/configuration (or the analytics configuration page), show a minimal example, and state the failure behavior.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 8cafa3b)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 8cafa3b)Status: No Issues Found | Recommendation: Merge All six issues from the previous review have been resolved by commit
Verified both internal links ( Files Reviewed (2 files)
Previous review (commit 7154af8)Status: 6 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (2 files)
Reviewed by minimax-m3 · Input: 38.6K · Output: 2K · Cached: 188.4K |
Summary
cart_idandcheckout_idcorrelation plus coupon and discount propertiesValidation
npm run buildThe standalone link validator continues to report the repository's existing relative-link and invalid-fragment baseline; this change adds no internal links.