GA4 Experiment Tracking Setup
Choose and configure the right tracking approach for your A/B experiments.
GA4 Experiment Tracking Setup
ClickMint CRO Platform — Client Documentation Last updated: April 2026
Overview
ClickMint setup follows a simple two-step story:
- Configure GA4 for ClickMint by registering the
cm_trackingevent and the custom dimensions ClickMint relies on for reporting. - Install the ClickMint script using the pattern that matches your site:
- Approach 1: Direct / Native install for sites where GA4 is already installed directly in site code
- Approach 2: GTM serverless event tracking for GTM-, sGTM-, or consent-managed setups
This split matters because the GA4 configuration is shared across every installation path, but the best place to load the ClickMint script depends on how your site already loads GA4.
How ClickMint tracking works
When a visitor lands on a page running an experiment:
- The ClickMint script loads from
https://experiments.api.clickmint.com/{YOUR_ORG_TOKEN}{page-path}. - It checks whether an active experiment exists for that page and assigns the visitor to a control or variant experience.
- It sets the GA4 user-scoped tracking property ClickMint currently relies on:
experiment_id. - It fires a
cm_trackingevent with experiment metadata such asoutcome_id,outcome_index,outcome_type,experiment_mode, andevent_typefor diagnostics and reporting. - Later in the same session, GA4 attaches the persisted
experiment_iduser property to downstream events likepurchase, allowing ClickMint to correlate conversion activity back to the tracked visitor journey.
Important: ClickMint does not inject cart tracking, checkout tracking, revenue tracking, or PII capture. It records the experiment assignment in your GA4 property, then reads aggregate results back from GA4 through the Reporting API.
Step 1 — Register the cm_tracking event and GA4 custom dimensions
cm_tracking event and GA4 custom dimensionsThis step is required before either installation approach will report correctly.
A. Optional but recommended: grant ClickMint GA4 Viewer access
If you have not already done so, complete GA4 Integration Setup first so ClickMint can read reporting data from your GA4 property.
B. Create the cm_tracking custom event
cm_tracking custom eventIn GA4 → Admin → Data display → Events → Create event, add one custom event:
| Custom event name | Matching condition |
|---|---|
cm_tracking | event_name equals cm_tracking |
C. Register the required user-scoped custom dimension
In GA4 → Admin → Data display → Custom definitions → Create custom dimension, register the following with Scope = User.
This is the key user-scoped dimension ClickMint's current reporting pipeline relies on.
| Suggested name | User property name | Why it matters |
|---|---|---|
| CM User Experiment ID | experiment_id | Persistent ClickMint tracking ID used for cross-session attribution and reporting |
Important: older internal references may mention additional user-scoped properties such as
experiment_variant,outcome_id, oroutcome_index. For the current customer-facing setup,experiment_idis the required user-scoped custom definition to register.
D. Register the recommended event-scoped custom dimensions
Still in Custom definitions, register the following with Scope = Event.
These are recommended for DebugView checks, diagnostics, and implementation support. ClickMint's current reporting flow depends on the event payload for outcome-level context.
| Suggested name | Event parameter | Description |
|---|---|---|
| CM Event Type | event_type | Impression type such as variant_loaded, control, or error |
| CM Experiment ID | experiment_id | Experiment identifier on the cm_tracking event |
| CM Experiment Mode | experiment_mode | Usually production or preview |
| CM Experiment Variant | experiment_variant | Variant token carried on the event |
| CM Outcome ID | outcome_id | Outcome / variant UUID |
| CM Outcome Index | outcome_index | Numeric variant index |
| CM Outcome Type | outcome_type | redirect, repaint, control, or error descriptor |
| CM Page Path | page_path | Page path where the assignment occurred |
⚠️ GA4 processing delay: after creating new custom definitions, allow 24–48 hours before conversion data appears reliably in ClickMint. DebugView can show events sooner, but Data API-backed reports take longer.
Step 2 — Choose how to install the ClickMint script
Once GA4 is configured, choose the installation path that matches how GA4 is already deployed on your site.
| Approach 1: Direct / Native install | Approach 2: GTM serverless event tracking | |
|---|---|---|
| Best for | Sites where GA4 already lives directly in site code / <head> | Sites where GA4 is managed by GTM, sGTM, Consent Mode v2, Elevar, etc. |
| GA4 ownership | Direct gtag.js or native code install | Existing Google Tag / GA4 Configuration tag stays in place |
| Preferred script location | Directly in the page <head> | Also directly in the page <head> when possible |
| Fallback if head access is unavailable | N/A | Use the complete GTM template and accept a presentation delay |
| Primary tradeoff | Requires code or CMS head access | More moving parts, but protects existing GTM / consent architecture |
Choose Approach 1 if…
- Your site already loads GA4 directly in theme files, templates, or application code
- You can edit the page
<head>(or a CMS field that writes into the<head>) - You want the fastest possible experiment presentation with the least GTM complexity
→ Go to Approach 1: Direct / Native Script Installation
Choose Approach 2 if…
- Your GA4 setup is managed by GTM, server-side GTM (sGTM), Consent Mode v2, or a vendor-managed stack such as Elevar or Littledata
- You want to keep your current Google Tag / GA4 configuration intact
- You need ClickMint to plug into your existing GTM measurement flow instead of replacing it
Approach 2 includes two GTM options:
- Preferred: import the events-only GTM template and install the ClickMint script manually in
<head> - Fallback: import the complete GTM template and let GTM inject the script, with a clear tradeoff: the experiment can appear later because GTM often appends Custom HTML near the end of
<body>
→ Go to Approach 2: GTM Serverless Event Tracking
Need vendor-specific GTM notes?
If you are working inside Elevar, Segment, Shopify + GTM, Tealium, Adobe, or another vendor-managed analytics stack — or you are migrating from the older GTM Custom HTML instructions — use the supplemental guide:
→ GTM Platform Notes & Migration Guide
Privacy, consent, and attribution notes
These points are especially useful for legal, compliance, and analytics reviewers:
- No direct PII collection: ClickMint's script does not collect names, email addresses, billing information, cart contents, form inputs, or click / scroll tracking.
- Revenue comes from your GA4 property: ClickMint does not generate purchase data itself — it reads revenue and conversion events from the GA4 implementation you already own.
- Consent is respected: if your CMP blocks GA4 entirely until consent is granted, the experiment can still run but no tracking event is sent until GA4 becomes available.
- Consent Mode v2 behavior follows Google: when Consent Mode v2 is active, ClickMint does not bypass or override consent signals. Whatever GA4 is allowed to collect under the active consent state is what ClickMint inherits.
If your compliance posture requires certainty that no events reach GA4 before consent, the safest pattern is to block the GA4 tag entirely until consent is granted rather than relying only on Consent Mode v2 restrictions.
FAQ
Will I lose historical GA4 data?
No. You keep the same GA4 property and measurement ID. You are only changing how ClickMint experiment assignment is sent into that property.
Why is manual <head> install preferred for GTM-managed sites?
<head> install preferred for GTM-managed sites?Because GTM Custom HTML tags are frequently appended near the end of <body>. That can delay when ClickMint applies the experiment, which may create a visible flash of the original page before the variant loads.
What if I cannot edit the page <head> at all?
<head> at all?Use Approach 2, Option B — the complete GTM template. It is a valid fallback, but it is slower than manual head install and should be used only when direct head placement is unavailable.
Does ClickMint still work if my CMP blocks analytics consent?
Yes — the experiment delivery still works, because that happens before GA4 tracking. Only the measurement is blocked when GA4 is unavailable.
I see "data flowing" in GA4. Is that enough?
Not by itself. Confirm that a cm_tracking event appears in GA4 DebugView, that it carries experiment parameters, and that the visitor session includes the experiment_id user property.
What if I am on Shopify and cannot edit theme code?
If your theme or app setup exposes a reliable way to write to the page <head>, use that. Otherwise, use Approach 2 and start with the GTM serverless guide.
Getting help
If you run into issues or need assistance:
- Email: [email protected]
- In-App Chat: Log in to your ClickMint dashboard and use the chat widget
When contacting support, please include:
- Your GA4 Measurement ID (for example
G-XXXXXXXXXX) - Which installation path you used (
Direct / Native,GTM serverless Option A, orGTM serverless Option B) - A screenshot of the
cm_trackingevent in GA4 DebugView - A screenshot of Tag Assistant / GTM Preview if GTM is involved
- The URL of the page you are testing
Updated 8 days ago
