Technical Reference

For the technical owner: how tracking works, exactly what is sent to GA4, troubleshooting, and the GTM edge cases.

The Quick Start covers doing; this page covers understanding and fixing. It is written for the engineer or analyst who owns the site's tagging.


How ClickMint tracking works

When a visitor lands on a page with an active experiment:

  1. The ClickMint script loads from https://experiments.api.clickmint.com/{ORG_TOKEN}{page-path} — the snippet in the page <head> is its loader.
  2. The script assigns the visitor to control or a variant in the browser, using a stable local tracking token — the same visitor keeps the same experience on return visits.
  3. It applies the variant (or leaves the page untouched for control).
  4. It fires exactly one cm_tracking event into your GA4 property through the page's own Google tag (gtag), and sets the experiment_id user property to the visitor's tracking token.
  5. GA4 attaches that user property to the visitor's later events — including purchase — which is how ClickMint attributes conversions and revenue to the right arm.

The script sends one event per page view and nothing else. All revenue/conversion figures in the ClickMint dashboard are read from your GA4 property via the Reporting API — ClickMint generates none of its own. Because the event goes through your Google tag, it obeys your consent setup like every other GA4 event (consent details).


What gets sent

Event parameters

All eight parameters are present on every cm_tracking event.

ParameterExampleMeaning
event_typevariant_loadedWhat happened: variant_loaded (a variant applied), control (unchanged page), or error (a variant failed to apply; details in outcome_type)
experiment_idcm_lx2k…The visitor's ClickMint tracking token — not an experiment identifier (the name is historical). Matches the experiment_id user property
experiment_modeproductionproduction for real traffic; preview for team members previewing via a preview link
experiment_variantcm2.lInternal delivery marker used by ClickMint diagnostics. Not the variant identity — that is outcome_id
outcome_idproducts-widget_1The experiment arm: a page key plus the variant index. Index 0 (e.g. products-widget_0) is always control
outcome_index1The numeric variant index as a string. 0 = control
outcome_typerepaintHow the variant was delivered: redirect (variant URL), repaint (page modified in place), control, or an error description
page_path/products/widgetThe path where the assignment happened — no query strings, no full URL

User property

PropertyMeaning
experiment_idThe visitor's tracking token, set via gtag('set', 'user_properties', …) immediately before each event. GA4 attaches it to the visitor's subsequent events — including purchase — enabling per-arm conversion and revenue attribution

The token is a random, locally-generated identifier with an embedded creation time. No PII — full inventory in Data Privacy & Consent.

Key event status

cm_tracking is registered as a GA4 key event via Create event → Create with code (Quick Start 2a). The registration declares the event; the ClickMint script is the code that sends it.

The four data rules

  1. One installation. The snippet exists in exactly one place on the site.
  2. One event per page view. Never re-send, forward, or copy cm_tracking with another tag — except the one gated GTM topology in the GTM Installation Guide.
  3. Declare, never derive. Never create a condition-based GA4 "Create event" rule matching cm_tracking — it re-emits every event.
  4. Never rename or re-map the parameters. ClickMint's reporting queries these exact names; remapping silently breaks the dashboard.

The one-event rule and how to count

Every page view on an experiment page produces exactly ONE cm_tracking event. One means trustworthy data; zero means broken measurement; two or more means every metric is inflated.

Three independent counters:

  • Console: a healthy load prints one [ClickMint] Tracked: cm_tracking … line. Two lines = the script executed twice (double install).
  • Tag Assistant: connect, open the GA4 destination (G-…), read Hits sent for one page load — cm_tracking once.
  • GA4 DebugView: one cm_tracking per page load, carrying the parameters above, with experiment_id in the User properties panel.

Also confirm the script itself: the Network tab shows one request to experiments.api.clickmint.com/… returning JavaScript.


Troubleshooting: you counted TWO

Work these in order — each is a known real-world cause.

Cause 1 — A cm_tracking "Create event" rule with a matching condition

Check: GA4 → Admin → Data display → Events → Create event → All custom events. An entry named cm_tracking with a matching condition (event_name equals cm_tracking) was created via "Create without code" and re-emits every event.

Fix: delete the condition-based rule, then re-register correctly: Create event → Create with code, key event ON, Once per event (Quick Start 2a). The "with code" form only declares — it re-emits nothing.

Cause 2 — Two GA4 installations on the page

Check: in the console: document.querySelectorAll('script[src*="googletagmanager.com/gtag/js"]').length — more than 1, or a hardcoded GA4/GTM snippet in the theme plus a platform integration (e.g. Shopify's Google & YouTube channel), means two tag stacks each deliver the same event.

Fix: keep exactly one GA4 installation. On Shopify, prefer the Google & YouTube channel and remove hardcoded theme snippets for the same measurement ID.

Cause 3 — A GTM tag forwarding cm_tracking

Check: in GTM, a GA4 Event tag firing on a Custom Event trigger named cm_tracking (older ClickMint setups: cm event tracking - serverless).

Fix: when any Google tag for the measurement ID processes gtag commands on the page, the script's event already reaches GA4 — the forwarding tag doubles it. Pause/delete the tag, its trigger, and the cm dl * variables. The only topology that legitimately needs it is the gated exception in the GTM Installation Guide — and that topology counts zero without it, never one.

Cause 4 — The ClickMint snippet installed twice

Check: two [ClickMint] console line sets per page load. Search the theme/templates for experiments.api.clickmint.com and check tag managers and platform pixel surfaces for a second copy.

Fix: exactly one installation, preferably <head>.


Troubleshooting: you counted ZERO

  1. Script not loading — no request to experiments.api.clickmint.com in the Network tab → the snippet isn't on this page (Platform Install Guides).
  2. Console says gtag not available, skipping tracking — the page has no Google tag the script can use. If GA4 lives only inside GTM (no gtag.js, no platform GA4 integration), gtag-style events are not delivered automatically — this is the one case for event forwarding in the GTM Installation Guide. After importing, re-verify: count must be exactly one.
  3. Consent pending — a CMP that blocks GA4 until consent also blocks the event. Accept consent in the test browser and re-check; this is correct behavior, not a fault.

End-to-end attribution check

  1. In DebugView, note the experiment_id user property after visiting an experiment page.
  2. Complete a test conversion in the same session.
  3. Open that event in DebugView — the same experiment_id should be attached. That linkage powers per-arm conversion and revenue reporting.

Newly registered custom dimensions take 24–48 hours before the ClickMint dashboard reports on them. DebugView is immediate.

Symptom quick table

SymptomLikely causeFix
No request to experiments.api.clickmint.comSnippet missing on the pagePlatform Install Guides
Count is 2Causes 1–4 aboveWork the list in order
Count is 0, console shows gtag not availableGA4 exists only inside GTMGTM Installation Guide, then re-verify
Variant flashes after the original page showsScript loading late (footer / GTM-injected)Move the snippet into <head>
experiment_id user property missingScript blocked or GA4 unavailable at event timeCheck console errors and consent state; re-test
Dashboard conversions zero after 48 hDimensions unregistered, or no purchase eventsQuick Start 2b; confirm your ecommerce tagging

Did this page help you?