Insightech and Intelligems
Updated
by Tami Lopez
Overview
Intelligems is an A/B testing and optimisation platform built for Shopify merchants. It enables teams to run experiments across content, pricing, shipping rates, and checkout experiences — assigning each visitor to a test group and measuring the impact on revenue and profit.
This document explains how to integrate Intelligems experiment and test group data with Insightech by pushing assignment details into the website's dataLayer using Intelligems' client-side JavaScript API. Because Insightech captures all dataLayer events automatically, no additional Insightech configuration is required beyond the standard setup.
What This Integration Does
The integration reads Intelligems experiment data from the page as soon as it is available, then pushes the details to the dataLayer once per experiment per page load — for every visitor, including those assigned to the control group.
This includes:
- Experiment ID – The unique UUID of the experiment
- Experiment Name – The human-readable name of the experiment
- Test Group ID – The unique UUID of the test group this visitor was assigned to
- Test Group Name – The human-readable name of the test group (e.g. 'Control Group', 'Variant A')
- Is Control – Whether this visitor was assigned to the control group
This enables Insightech to:
- Unify your data – Combine A/B test data with behavioural analytics in Insightech
- Create advanced segments – Build audiences based on specific experiments and test groups
- Behavioural Attribution – Understand how tests impact downstream metrics such as on-page engagement, AOV, and conversions
- Explore successful and failed tests – Analyse on-page behaviours and customer journeys to understand why tests succeeded or failed, informing further improvements
Implementation Steps
This integration uses Intelligems' own client-side JavaScript API ('igData') and the 'onIgReady' callback, which fires as soon as the Intelligems script has fully loaded on the page. The snippet is added directly to your Shopify theme — no additional platform configuration is required.
Prerequisites before implementing:
- The Intelligems script must already be installed in your Shopify theme.liquid.
- At least one experiment must be active and live for data to appear in the dataLayer.
- Experiments must have active traffic allocations — paused or ended experiments will not return data from getExperiments().
Step 1: Add the Snippet to theme.liquid
- In your Shopify admin, go to Online Store → Themes → Edit Code
- Open theme.liquid
- Paste the code below above the closing </body> tag, after the Intelligems script
- Save the file
Step 2: Paste the Integration Code
// Add this snippet to your Shopify theme.liquid, above the closing </body> tag.
// It uses Intelligems' onIgReady callback to ensure the igData object is
// available before reading experiment data.
<script>
window.onIgReady = function() {
try {
var experiments = window.igData?.user.getExperiments();
if (!experiments || !experiments.length) return;
window.dataLayer = window.dataLayer || [];
experiments.forEach(function(experiment) {
var testGroup = window.igData?.user.getTestGroup(experiment.id);
if (!testGroup) return;
window.dataLayer.push({
event: 'ig_experiment_impression',
ig_experimentId: String(experiment.id || ''),
ig_experimentName: String(experiment.name || ''),
ig_testGroupId: String(testGroup.id || ''),
ig_testGroupName: String(testGroup.name || ''),
ig_isControl: String(testGroup.isControl === true)
});
});
} catch(e) {
console.warn('Intelligems dataLayer integration error:', e);
}
};
</script>
NOTE - window.onIgReady is Intelligems' recommended callback pattern. If the Intelligems script has already been loaded by the time this code runs, the callback will execute immediately. This ensures the integration works regardless of script load order.
Understanding the DataLayer Event
This integration pushes a single ig_experiment_impression event to the dataLayer for each active experiment the visitor has been assigned to. It fires once per experiment per page load.
The ig_experiment_impression Event
Fires once per active experiment on page load, after Intelligems has assigned the visitor to a test group. This includes visitors assigned to the control group. Use this event for granular per-experiment segmentation in Insightech.
{
event: 'ig_experiment_impression',
ig_experimentId: '8bce9d31-cd20-4f4a-a070-a6970c7e9803',
ig_experimentName: 'Homepage Hero Test',
ig_testGroupId: 'c2fdce4d-c3e2-4cf0-92aa-d3498ee67cc9',
ig_testGroupName: 'Variant A - Blue CTA',
ig_isControl: 'false'
}Field | Example Value | Description |
ig_experimentId | '8bce9d31-...' | The unique UUID of the experiment (maps to experiment.id in igData) |
ig_experimentName | 'Homepage Hero Test' | The human-readable experiment name (maps to experiment.name in igData) — use this as your experiment identifier in Insightech |
ig_testGroupId | 'c2fdce4d-...' | The unique UUID of the test group this visitor was assigned to (maps to testGroup.id in igData) |
ig_testGroupName | 'Variant A - Blue CTA' | The human-readable test group name (maps to testGroup.name in igData) — use this as your variant identifier in Insightech |
ig_isControl | 'false' | String: 'true' if visitor was assigned to the control group; 'false' for all other test groups (maps to testGroup.isControl in igData) |
Note on naming: If a visitor is active in multiple experiments simultaneously, one ig_experiment_impression event will fire for each experiment — you will see multiple events in the dataLayer. Each event contains data for a single experiment only.
Setting Up / Configuring Insightech
Once the integration is live, Insightech will automatically capture the dataLayer events and make them available in the AB Test report, accessible from your left menu.
Clicking into this menu, you will be prompted to search for your Intelligems event name and select which attributes to use for your experiment and variant details.
Once configured, your Intelligems data will start populating the AB testing report for any active experiments tracked using this method.
Recommended Field Mapping
Insightech Field | Dynamic Yield DataLayer Field | Notes |
Experiment / Campaign Name | ig_experimentName | Human-readable experiment name; matches experiment.name in igData |
Variant Name | ig_testGroupName | Human-readable test group name; 'Control Group' for control visitors |
Variant ID | ig_testGroupId | UUID of the test group; useful for programmatic filtering |
Control Flag | ig_isControl | String: 'true' = control group visitor, 'false' = test group visitor |
Verifying the Integration Is Working
- Open your Shopify storefront in a browser
- Open the browser developer console (F12 or right-click → Inspect → Console)
- Type dataLayer and press Enter
- Look for ig_experiment_impression events in the output — one per active experiment on the page
- Verify the data structure matches the example above and that ig_experimentName and ig_testGroupName are populated
- Confirm that control group visitors show ig_isControl: 'true' (as a string) and ig_testGroupName matching the control group name set in Intelligems
✓ You should see one ig_experiment_impression event per active experiment.
✓ If the visitor is in multiple experiments, you will see multiple events — one per experiment.
✓ For control group visitors, ig_isControl will be the string 'true'.
Troubleshooting
When DataLayer Events Are Not Appearing
Verify the Intelligems script is installed
- Open the browser console and type window.igData. This should return an object. If it returns undefined, the Intelligems script has not loaded on the page.
- Confirm the Intelligems script is installed in theme.liquid and not loaded via the Shopify app embed, which loads it asynchronously and may cause timing issues.
Verify the snippet placement
- Confirm the integration snippet is placed in theme.liquid after the Intelligems script tag and above the closing </body> tag.
- If window.onIgReady is set before the Intelligems script loads, it will execute automatically once Intelligems is ready. If set after, it will execute immediately.
When There Is No Experiment Data in Events
Check that experiments are active
- Confirm the experiments you want to track are published, live, and have active traffic allocations in the Intelligems dashboard.
- Paused or ended experiments will not be returned by getExperiments() and will not appear in the dataLayer.
Verify targeting conditions
- Check the experiment's audience and page targeting settings. If the current visitor or page does not meet the targeting criteria, the experiment will not be returned.
- If you are testing in a logged-in admin session, check whether any preview or exclusion rules apply to your account.
If Events Are Firing Multiple Times
Check for duplicate snippets
- Ensure the integration snippet is added only once in theme.liquid.
- Check that window.onIgReady is not being set in multiple places across your theme files.
- Note: if a visitor is enrolled in multiple simultaneous experiments, one ig_experiment_impression event will fire per experiment — this is expected behaviour, not a duplicate.
Quick Reference: DataLayer Fields
Field | Event | Type | Description |
event | String | Always 'ig_experiment_impression' | event |
ig_experimentId | String | UUID of the Intelligems experiment (experiment.id) | ig_experimentId |
ig_experimentName | String | Human-readable experiment name (experiment.name) | ig_experimentName |
ig_testGroupId | String | UUID of the test group assigned to this visitor (testGroup.id) | ig_testGroupId |
ig_testGroupName | String | Human-readable test group name (testGroup.name) | ig_testGroupName |
ig_isControl | String | String: 'true' if visitor is in the control group; 'false' for all other groups (testGroup.isControl) | ig_isControl |
For support, contact Insightech at support@insightech.com or visit insightech.com/support