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:
- The ClickMint script loads from
https://experiments.api.clickmint.com/{ORG_TOKEN}{page-path}— the snippet in the page<head>is its loader. - 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.
- It applies the variant (or leaves the page untouched for control).
- It fires exactly one
cm_trackingevent into your GA4 property through the page's own Google tag (gtag), and sets theexperiment_iduser property to the visitor's tracking token. - 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.
| Parameter | Example | Meaning |
|---|---|---|
event_type | variant_loaded | What happened: variant_loaded (a variant applied), control (unchanged page), or error (a variant failed to apply; details in outcome_type) |
experiment_id | cm_lx2k… | The visitor's ClickMint tracking token — not an experiment identifier (the name is historical). Matches the experiment_id user property |
experiment_mode | production | production for real traffic; preview for team members previewing via a preview link |
experiment_variant | cm2.l | Internal delivery marker used by ClickMint diagnostics. Not the variant identity — that is outcome_id |
outcome_id | products-widget_1 | The experiment arm: a page key plus the variant index. Index 0 (e.g. products-widget_0) is always control |
outcome_index | 1 | The numeric variant index as a string. 0 = control |
outcome_type | repaint | How the variant was delivered: redirect (variant URL), repaint (page modified in place), control, or an error description |
page_path | /products/widget | The path where the assignment happened — no query strings, no full URL |
User property
| Property | Meaning |
|---|---|
experiment_id | The 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
- One installation. The snippet exists in exactly one place on the site.
- One event per page view. Never re-send, forward, or copy
cm_trackingwith another tag — except the one gated GTM topology in the GTM Installation Guide. - Declare, never derive. Never create a condition-based GA4 "Create event" rule matching
cm_tracking— it re-emits every event. - 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_trackingonce. - GA4 DebugView: one
cm_trackingper page load, carrying the parameters above, withexperiment_idin 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
cm_tracking "Create event" rule with a matching conditionCheck: 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
cm_trackingCheck: 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
- Script not loading — no request to
experiments.api.clickmint.comin the Network tab → the snippet isn't on this page (Platform Install Guides). - Console says
gtag not available, skipping tracking— the page has no Google tag the script can use. If GA4 lives only inside GTM (nogtag.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. - 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
- In DebugView, note the
experiment_iduser property after visiting an experiment page. - Complete a test conversion in the same session.
- Open that event in DebugView — the same
experiment_idshould 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
| Symptom | Likely cause | Fix |
|---|---|---|
No request to experiments.api.clickmint.com | Snippet missing on the page | Platform Install Guides |
| Count is 2 | Causes 1–4 above | Work the list in order |
Count is 0, console shows gtag not available | GA4 exists only inside GTM | GTM Installation Guide, then re-verify |
| Variant flashes after the original page shows | Script loading late (footer / GTM-injected) | Move the snippet into <head> |
experiment_id user property missing | Script blocked or GA4 unavailable at event time | Check console errors and consent state; re-test |
| Dashboard conversions zero after 48 h | Dimensions unregistered, or no purchase events | Quick Start 2b; confirm your ecommerce tagging |
Updated 21 days ago
