Repository navigation
next-campaigns-setup 2.0.1: custom analytics is a next.analytics.on listener in Cart SDK 0.5 - #93
Conversation
…istener in Cart SDK 0.5
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Notes and Assumptions
Previous Review Summaries (3 snapshots, latest commit 0ddcbb9)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 0ddcbb9)This review did not run. Your provider API key hit its rate limit, so the Previous review (commit 0ddcbb9)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Notes and Assumptions
Fix these issues in Kilo Cloud Previous review (commit 49b0a06)Status: 5 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (2 files)
Notes and Assumptions
Reviewed by minimax-m3 · Input: 48.1K · Output: 7.4K · Cached: 614K |
…nalytics, 0.5 destinations note
| - Set `facebook.enabled` to `true` | ||
| - Set `facebook.settings.pixelId` to the provided ID | ||
|
|
||
| The `gtm` and `facebook` keys above live in the template's `analytics.providers` block. Writing them is intentional while the starter templates ship that block: SDK 0.5 still reads it. If the template's `config.js` has an `analytics.destinations` block instead, set `destinations.gtm.enabled` and `destinations.meta.enabled` to `true` there, because a `destinations` setting wins over `providers` and the provider write would do nothing. Destinations take no IDs (only `enabled`, plus `meta.storeName`): the container and Pixel load from `gtm_id` and `fb_pixel_id` in `campaigns.json` (Step 10), and the destinations send through what the page loaded. |
There was a problem hiding this comment.
WARNING: The destinations branch names meta.storeName as a destinations field but never tells the agent to set it — the same class of gap as the finding this sentence was written to close.
This sentence establishes that analytics.destinations entries take only enabled plus meta.storeName. It then instructs the agent to set destinations.gtm.enabled and destinations.meta.enabled — but nothing instructs it to write destinations.meta.storeName. The only storeName instruction in this skill is step 9 item 2 (line 192), which sets the top-level config.js storeName.
That leaves a concrete failure on a destinations-based template: the agent writes the correct top-level storeName slug, leaves destinations.meta.storeName at whatever the template shipped, and — by the precedence rule this very sentence states ("a destinations setting wins over providers") — the stale destinations value is the one the SDK reads. The Meta destination then reports under the wrong store identifier.
The sentence also does not say what value meta.storeName takes. If it is the same analytics store slug as the top-level storeName, say so and instruct the agent to set it; if it is a different identifier (e.g. a Meta CAPI store identifier), say what it is, otherwise an agent has no way to choose a value.
Suggested addition to the destinations branch:
If the template's `config.js` has an `analytics.destinations` block instead, set `destinations.gtm.enabled` and `destinations.meta.enabled` to `true` there, and set `destinations.meta.storeName` to the same slug as the top-level `storeName`.
There was a problem hiding this comment.
Declined for now and left open for Devin. The precedence is real (destinations.meta.storeName wins over the top-level storeName), but it only bites on a template that already ships analytics.destinations.meta.storeName. No starter template does: they pin 0.4.43 and ship analytics.providers. The destinations branch should be written in full when the templates move to 0.5, against the block they actually ship.
🤖 Addressed by Claude Code
| - Set `facebook.enabled` to `true` | ||
| - Set `facebook.settings.pixelId` to the provided ID | ||
|
|
||
| The `gtm` and `facebook` keys above live in the template's `analytics.providers` block. Writing them is intentional while the starter templates ship that block: SDK 0.5 still reads it. If the template's `config.js` has an `analytics.destinations` block instead, set `destinations.gtm.enabled` and `destinations.meta.enabled` to `true` there, because a `destinations` setting wins over `providers` and the provider write would do nothing. Destinations take no IDs (only `enabled`, plus `meta.storeName`): the container and Pixel load from `gtm_id` and `fb_pixel_id` in `campaigns.json` (Step 10), and the destinations send through what the page loaded. |
There was a problem hiding this comment.
WARNING: The new destinations branch has no counterpart in step 5, so "tracking is intentionally not configured" can still fire a template-shipped destination.
This sentence adds a second write surface for tracking (analytics.destinations) but step 5 ("Absent tracking", line 202) only speaks in terms of the providers keys: "keep GTM/Facebook disabled or blank. Remove obvious placeholder IDs if the template copied them." That reads as gtm.enabled / facebook.enabled under analytics.providers, and the destinations keys are spelled out with their full paths here precisely because they are different keys.
So on a template that ships an analytics.destinations block with gtm.enabled: true (or a placeholder container), an agent that follows step 5 literally leaves destinations.gtm.enabled as true. Because destinations wins over providers, that placeholder destination is what fires — while the report template claims "GTM enabled with real ID / left disabled" (line 246) and tracking was recorded as not_configured. That is a silent no-op reported as an intentional non-configuration.
The destinations branch needs a mirrored absent-tracking rule, e.g.: "If tracking status is unknown or not_configured, set destinations.gtm.enabled and destinations.meta.enabled to false in the destinations block if one is present."
There was a problem hiding this comment.
Declined for now and left open for Devin, for the same reason: it assumes a template that ships an analytics.destinations block with GTM switched on. None does today (the starter templates pin 0.4.43 with analytics.providers). The "Absent tracking" rule for destinations belongs with the template move to 0.5, where the shipped block is known.
🤖 Addressed by Claude Code
Campaign Cart SDK 0.5.0 has no custom analytics provider.
analytics.providers.custominconfig.jsnow only logs a warning and sends nothing. Until now, step 8 of next-campaigns-setup told agents to rely on that provider whenever the template config had one.Changes in 2.0.1
next.analytics.on('*', …), and links the SDK's By hand section.custom_required, the skill no longer adds aproviders.customblock. The listener is passed tonext-campaigns-buildas a follow-up.The
storeNameandgtm/facebookprovider steps (step 9) stay as they are for now. The starter templates still ship 0.4-styleconfig.jsblocks, and 0.5 still reads those keys (destinations.*takes precedence). That step should change when the templates move toanalytics.destinations.check_skill_versions.py --base origin/mainandcheck_public_safety.pyboth pass.