Measurement Debug

by spotify532b47af3d2eNo licenseListed Oct 8, 2026Updated Oct 8, 2026

Diagnose existing Spotify Ads Pixel, Conversions API (CAPI), and dataset implementations when events are missing, stale, duplicated, unexpectedly high or low, not deduplicated, attached to the wrong account, or present in diagnostics but absent from campaign reporting. Use for Pixel/CAPI troubleshooting, event-delivery audits, token/connection mismatches, source comparison, or measurement incident triage. Prefer read-only checks and never create test conversions without explicit confirmation.

Instructions onlyData & Analytics
AI-generated overview

Diagnoses Spotify Ads Pixel, Conversions API and dataset measurement problems using read-only Ads API checks.

What it does
Guides a structured triage of Spotify Ads measurement incidents: it resolves the business, dataset, integration and ad-account topology, inspects event-receipt diagnostics, and isolates whether the fault lies in receipt, deduplication, sharing/selection or attributed reporting. It produces an incident report with a one-line topology, an evidence table, the most likely failing layer, owner-specific remediation and safe verification steps. Mutating actions such as test events, token changes or dataset sharing require explicit confirmation, and secrets or personal identifiers are never requested or exposed.
When to use it
Use when Spotify Ads Pixel or CAPI events are missing, stale, duplicated, unexpectedly high or low, not deduplicated, attached to the wrong account, or visible in diagnostics but absent from campaign reporting. Also suited to event-delivery audits, token or connection mismatch checks, source comparison and measurement incident triage.
Requirements
Requires access to the Spotify Ads API v3 and a business_id, plus the plugin's api-request.sh helper and the api-reference live OpenAPI document referenced by the skill. It ships no scripts of its own and is instructions only; it also references a troubleshooting.md file. Credentials for the Ads API are needed, and token responses must be treated as secret.

Spotify Ads API — Measurement Debug

Find the failing layer before recommending a change. Read troubleshooting.md [blocked] before diagnosing.

Setup

bash
PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-.}}"api() { "$PLUGIN_ROOT/scripts/api-request.sh" measurement-debug "$@"; }

Before the first Ads API v3 call, read and follow $PLUGIN_ROOT/skills/api-reference/references/live-openapi.md.

Measurement paths use business_id. Discover it with GET businesses when absent.

Triage

Capture:

  • expected event, expected volume, first/last known good time, timezone, and affected environment
  • Pixel, CAPI, or both; direct code, web GTM, server GTM, or another owner
  • business, dataset, integration, connection, and ad-account IDs
  • whether the problem is receipt, deduplication, sharing/selection, or attributed reporting
  • a sanitized failing request/response and trace ID when available

Do not ask for CAPI tokens, raw email/phone, cookies, device IDs, IP addresses, or production payloads. Ask for redacted field names and error metadata instead.

Read-only audit

1. Resolve topology

bash
api GET "businesses/<business_id>/pixels?include_events=true"api GET "businesses/<business_id>/capi/<capi_connection_id>"api GET "businesses/<business_id>/datasets"api GET "businesses/<business_id>/datasets/<dataset_id>"api GET "businesses/<business_id>/ad_accounts/<ad_account_id>/datasets"

The GET datasets endpoint does not accept limit or offset parameters. The GET pixels endpoint may return 403 for some businesses; if so, check the pixel field on individual dataset responses instead.

Only call GET businesses/<business_id>/capi/<capi_connection_id>/tokens when the incident specifically requires token inventory. The response includes active token values, not just IDs: treat the entire raw response as secret, never show it in a command result or transcript, and expose only redacted token IDs/counts in the final audit.

Verify that:

  • the expected integration is in the expected dataset
  • the dataset is shared to the intended ad account
  • each integration's dataset_id field points to the correct dataset (a null value means events are ingested but not routed — see isolation table)
  • Pixel domain and CAPI connection ID match the intended environment/business
  • when authentication is in scope, the token ID exists on the same CAPI connection; never display token values
  • dataset flags such as is_receiving_events and is_receiving_lead_events fit the symptom

2. Inspect event receipt

bash
api GET "businesses/<business_id>/datasets/<dataset_id>/diagnostics?granularities=HOURLY"api GET "businesses/<business_id>/datasets/<dataset_id>/diagnostics?granularities=DAILY"api GET "businesses/<business_id>/datasets/<dataset_id>/diagnostics?granularities=HOURLY&datasource_ids=<datasource_id>"

Compare each datasource's event names, counts, timestamps, and last_activity_ms. Convert timestamps explicitly and state the timezone. Use hourly data for recent incidents and daily data for trend comparison.

Receipt diagnostics answer “did Spotify receive events?” They do not prove trigger correctness, identifiers, deduplication, campaign data-source selection, or attribution.

3. Isolate the layer

ObservationLikely layerNext check
No source receives eventsimplementation/networkbase code or server request, auth, CSP, container, endpoint
Pixel absent, CAPI presentbrowserbase code, trigger, duplicate install, CSP, redirects
CAPI absent, Pixel presentservertoken/connection pair, payload, 4xx/5xx logs, server GTM container
Both present, total inflateddeduplicationsame real event uses same event_id on both sources
Diagnostics present, campaign metrics absentselection/attributiondataset shared and selected; date/window/privacy/report fields
Wrong site/account receives datatopology/configdomain, business, dataset membership, connection ID
Events stopped suddenlydeployment/credentialrelease time, GTM publish, token revocation, CSP/infrastructure change
Integration in dataset but dataset_id nulldataset routingintegration was moved via POST datasets with multiple integration_ids; events are ingested but not routed — fix by removing the integration and re-adding it to a properly-linked dataset

4. Inspect implementation evidence

If the user supplies a public page, browser access, GTM export, or sanitized CAPI example, inspect it read-only:

  • Pixel: compare pixel key and base/event code with Ads Manager; search direct installs for spdt; inspect console/network/CSP; verify event fires only at the intended action.
  • Do not conclude Pixel is absent merely because source HTML lacks spdt; tag managers can inject it at runtime.
  • Confirm the site is not using both direct and GTM installs.
  • Verify redirects preserve Spotify's spclid query parameter.
  • Web GTM is for Pixel; CAPI GTM requires a server container.
  • CAPI: validate envelope, event enum, unique stable event ID, ISO 8601 time, at least one identifier, SHA-256 normalization, optional source URL/action source, and revenue fields.

Never expose secrets or personal data in findings.

Mutating tests and fixes

Default to a remediation plan. Ask for explicit confirmation immediately before:

  • submitting any CAPI event, including a test event
  • creating/revoking a token
  • changing Pixel/CAPI/dataset metadata
  • sharing/unsharing a dataset
  • moving an integration between datasets

A test event changes measurement data. Prefer replaying a legitimate known event in a non-production integration with a stable unique event_id, and label/document it. Never blindly replay a production POST after a timeout or 5xx.

For source-code or GTM changes, provide the smallest isolated change and an acceptance test; do not claim the Ads API can deploy website or GTM code.

Attribution boundary

If receipt is healthy but reporting is not:

  1. verify the dataset is shared to and selected by the relevant campaign/ad set
  2. verify the report date range, entity, and conversion field
  3. distinguish total received event activity from attributed conversions
  4. account for attribution windows and privacy thresholding
  5. route reporting extraction to the report skill

Do not “fix” healthy ingestion to force attributed numbers to match internal analytics.

Incident report

Return:

  • symptom and affected scope
  • topology diagram in one line: business → dataset → source(s) → ad account
  • evidence table with check, result, timestamp/timezone, and confidence
  • most likely failing layer and alternatives
  • exact remediation by owner
  • safe verification steps and wait period
  • redacted trace IDs/errors for escalation

Label facts, inferences, and unverified assumptions separately. If the issue remains unresolved, recommend Spotify Ads API support with client ID, endpoint, sanitized request/response, timestamp, and sp_trace_id.

Guardrails

  • Begin read-only.
  • Wait at least 20 minutes after new event activity before diagnosing empty Ads Manager diagnostics.
  • Never request, echo, or store CAPI secrets or personal identifiers.
  • Never automatically retry POST, PATCH, or DELETE.
  • On 4xx, preserve the sanitized error and stop; on ambiguous POST failure, check receipt/resource state before any retry.

Source and attribution

Source:spotify/ads-claude-plugininskills/measurement-debugat commit532b47a

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal