Skip to content

next-campaigns-setup 2.0.1: custom analytics is a next.analytics.on listener in Cart SDK 0.5 - #93

Merged
next-devin merged 4 commits into
mainfrom
sdk-0-5-knowledge
Nov 9, 2026
Merged

next-devin merged 4 commits into
mainfrom
sdk-0-5-knowledge

Conversation

@next-devin

Copy link
Copy Markdown
Contributor

Campaign Cart SDK 0.5.0 has no custom analytics provider. analytics.providers.custom in config.js now 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

  • A custom analytics endpoint is recorded in the setup report. The skill now says the endpoint is wired as a page listener, next.analytics.on('*', …), and links the SDK's By hand section.
  • With custom_required, the skill no longer adds a providers.custom block. The listener is passed to next-campaigns-build as a follow-up.

The storeName and gtm / facebook provider steps (step 9) stay as they are for now. The starter templates still ship 0.4-style config.js blocks, and 0.5 still reads those keys (destinations.* takes precedence). That step should change when the templates move to analytics.destinations.

check_skill_versions.py --base origin/main and check_public_safety.py both pass.

Comment thread next-campaigns-setup/SKILL.md Resolved
Comment thread next-campaigns-setup/SKILL.md Resolved
Comment thread next-campaigns-setup/SKILL.md Resolved
Comment thread next-campaigns-setup/SKILL.md Resolved
Comment thread next-campaigns-setup/SKILL.md Resolved
@kilo-code-bot

kilo-code-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
next-campaigns-setup/SKILL.md 200 The destinations branch names meta.storeName as a destinations field but never instructs the agent to set it; the stale template value wins over the top-level storeName the agent writes
next-campaigns-setup/SKILL.md 200 The new destinations branch has no counterpart in step 5 ("Absent tracking"), so a template-shipped destinations.gtm.enabled: true still fires while the report claims tracking was left disabled
Files Reviewed (2 files)
  • next-campaigns-setup/SKILL.md - 2 issues
  • skills.json - 0 issues

Notes and Assumptions

  • Incremental scope. This run reviewed only the delta since 0ddcbb9 (commit 6417294): one sentence appended to next-campaigns-setup/SKILL.md:200 explaining that SDK 0.5 destinations take no IDs. skills.json was unchanged in the delta and was checked for parity only.
  • The previous finding is resolved. The prior WARNING ("the destinations branch enables destinations.gtm/destinations.meta but never sets the IDs") was addressed by this sentence: destinations take no IDs, and the container/Pixel load from gtm_id / fb_pixel_id in campaigns.json. That reference resolves correctly — Step 10 (### Step 10 — Update campaigns.json, line 207) writes exactly those two flat keys at lines 222-223.
  • The four findings from the review at 49b0a06 remain fixed. Re-verified against current HEAD: the listener snippet uses a [custom-endpoint-url] placeholder, sends Content-Type: application/json, and ends with .catch(() => {}); the Report Back template has a Custom analytics line (line 249); the key path is consistently analytics.providers.custom (lines 170 and 203); and the provider-vs-destinations precedence is now documented.
  • The two new findings are the same defect class the last sentence was written to close — an incomplete analytics.destinations write surface — expressed on the destinations fields and on the absent-tracking path that the new branch silently bypasses.
  • Version bump parity holds. SKILL.md frontmatter version: 2.0.1 and skills.json next-campaigns-setup.version both moved 2.0.0 → 2.0.1. scripts/check_skill_versions.py compares base → HEAD (not commit-by-commit), so the two post-bump content commits still satisfy the "package changed but version did not advance" check. The root README.md skills table renders name/domain/description only, so no regeneration is needed.
  • SDK schema could not be independently confirmed. Outbound network access is blocked in the review sandbox, so https://cart-sdk.nextcommerce.com/latest/analytics-reference/destinations/overview/ could not be fetched and campaign-cart's src/analytics/destinations.ts is not in this repo. The "destinations take no IDs (only enabled, plus meta.storeName)" claim rests on the author's check against campaign-cart v0.5.0, not on a reviewer-verified source. The meta.storeName finding is raised because the skill itself names that field as the only non-enabled destinations key and then never tells an agent what to write into it — that gap holds regardless of the SDK's exact semantics.
  • The next.analytics.on('*', (event) => …) callback signature remains unconfirmed against the SDK reference (single event object vs. (name, payload)). This was raised in the earlier review and is unchanged by this delta; if the SDK delivers two arguments, JSON.stringify(event) in the snippet serializes the event name instead of the payload.
  • No CI coverage for this content. scripts/tests/ has no test asserting next-campaigns-setup/SKILL.md content, and the public-safety / tests CI jobs are structural and hermetic. These findings are documentation-semantic and would not be caught by CI.
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
request was rejected before the review started. Kilo does not retry
automatically, because the quota is your provider's; push a new commit once it
resets. Any inline comments below are from an earlier review.

Previous review (commit 0ddcbb9)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
next-campaigns-setup/SKILL.md 200 The analytics.destinations branch enables destinations.gtm and destinations.meta but never writes the provided container ID and pixel ID, so destinations-based templates can enable tracking with missing or placeholder identifiers
Files Reviewed (2 files)
  • next-campaigns-setup/SKILL.md - 1 issue
  • skills.json - 0 issues

Notes and Assumptions

  • The four findings from the previous review were re-verified against current HEAD and are now fixed: the listener snippet uses a placeholder endpoint, JSON content type, and .catch(); the Report Back template has a Custom analytics line; the custom-provider key path is consistently analytics.providers.custom; and the provider-vs-destinations precedence is now documented.
  • The remaining finding is based on the destinations branch introduced in the latest commit, which enables destinations without specifying how the provided IDs are applied.
  • The exact destinations field names for the container ID and pixel ID could not be independently confirmed because the SDK documentation is external and outbound access is unavailable in the review sandbox.

Fix these issues in Kilo Cloud

Previous review (commit 49b0a06)

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
next-campaigns-setup/SKILL.md 170 fetch snippet is unsafe to copy verbatim: undeclared url identifier resolves to a relative path (payload POSTed back at the storefront origin), JSON body sent with no Content-Type header, and no .catch() on the request
next-campaigns-setup/SKILL.md 170 "record in the report" has no destination — the Report Back template (lines 218-238) has no field for the custom endpoint, notes, or the next-campaigns-build follow-up, so the endpoint is dropped from the handoff
next-campaigns-setup/SKILL.md 188 Config key path mismatch: step 8 names analytics.providers.custom, step 188 prohibits providers.custom — two different key paths, so the prohibition may not cover the key an agent would actually add
next-campaigns-setup/SKILL.md 188 Step 9 still writes only the legacy top-level gtm / facebook keys while the PR states SDK 0.5 gives destinations.* precedence — tracking can be written but silently ignored on templates shipping an analytics.destinations block

SUGGESTION

File Line Issue
next-campaigns-setup/SKILL.md 170 Link text "By hand" does not describe the target (destinations/overview); every other link in this file uses a descriptive anchor
Files Reviewed (2 files)
  • next-campaigns-setup/SKILL.md - 5 issues
  • skills.json - 0 issues (version bump to 2.0.1 matches the frontmatter bump; check_skill_versions.py parity rule satisfied)

Notes and Assumptions

  • Version bump parity is correct. SKILL.md frontmatter version: 2.0.1 and skills.json next-campaigns-setup.version both moved 2.0.0 → 2.0.1, which satisfies scripts/check_skill_versions.py (changed package must advance its version) and scripts/skill_catalog.py (frontmatter must match the manifest).
  • Generated README table is unaffected. README.md's generated skills table renders name/domain/description only, not versions, so no regeneration is needed for this bump.
  • No test coverage for this content. scripts/tests/ has no test asserting next-campaigns-setup/SKILL.md content, and the CI jobs (public-safety, tests) are structural/hermetic — they will not catch a regression in the step 8 / step 9 tracking instructions. The findings above are therefore documentation-semantic and would not be caught by CI.
  • SDK documentation could not be verified. Outbound network access is blocked in the review sandbox, so https://cart-sdk.nextcommerce.com/latest/analytics-reference/destinations/overview could not be fetched. The SDK's actual next.analytics.on callback signature (single event argument vs (eventName, payload)) is unconfirmed; if it is the latter, JSON.stringify(event) in the new snippet would serialize the event name rather than the payload. This was flagged inline on line 170 and should be confirmed against the SDK reference before merge.
  • The destinations.* precedence concern on line 188 is drawn from the PR description's own statement ("0.5 still reads those keys (destinations.* takes precedence)"), not from independently confirmed SDK behavior, for the same network reason.

Fix these issues in Kilo Cloud


Reviewed by minimax-m3 · Input: 48.1K · Output: 7.4K · Cached: 614K

Comment thread next-campaigns-setup/SKILL.md Resolved
- 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@next-devin
next-devin merged commit 4462cb2 into main Nov 9, 2026
3 checks passed
@next-devin
next-devin deleted the sdk-0-5-knowledge branch November 9, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant