Skip to main content

Connect ABConvert to Google Analytics

Understanding ABConvert's GA4 Integration

Written by Leo
Updated today

This feature is currently available by invite only. If you'd like to get access, please reach out to our support team and we'll get you set up.

Overview

You can connect ABConvert to your Google Analytics 4 property to analyze how your experiments affect real store performance.

Once connected, ABConvert sends experiment data directly into GA4, so you can compare how visitors in different test groups (Control vs. Variant) behave, convert, and contribute to revenue.

What Data Gets Sent

Each time a visitor is assigned to an experiment, ABConvert sends the following with the event:

Parameter

What it contains

abconvert_experiment_id

Unique ID of the experiment

abconvert_experiment_name

Experiment name (as set in ABConvert)

abconvert_variant_id

Group index (0 = Control, 1 = Variant A, etc.)

abconvert_variant_name

Variant name (as set in ABConvert)

abconvert_exp_variant_string

Combined experiment ID + variant ID

abconvert_assignment_reason

How the visitor was assigned:
1. random_split (no audience filter, visitor was assigned randomly)

2. force_assign_group (visitor matched a specific audience rule)

How to Set It Up

Step 1: Set up GA4 data stream

  • Create a data stream by following this guide and choose "Web".

  • Input the url of your Shopify store and give it a name, then click "Create & Continue".

  • Once created, please click it and you will see Measurement ID here (we will use it in the next step).

Step 2: Add the tracking script to your Shopify theme

  • Click "View tag instructions" in the above image and click tab "Install manually", copy the google tag script.

  • Go to your Shopify Store > Sales channels > Online Store > three dots next to Edit theme button on the live theme > Edit code.

  • Paste the script immediately after the <head> element of file layout/theme.liquid.

    • If you have other theme files added by page builder apps like Gempages and Pagefly, please also add in those files.

Step 3: Enter your GA4 Measurement ID

  1. In ABConvert, go to Settings > Google Analytics 4 (GA4).

  2. Enter your Measurement ID (it looks like G-XXXXXXXXXX) and click Save.

  3. Make sure you have at least one active experiment running.

That's it on the ABConvert side. From this point on, ABConvert will automatically send an event called abconvert_experience_impression to GA4 each time a new visitor is assigned to an experiment group.

Step 4: Check If Your Data Was Sent to GA4 Successfully

  • Go to GA4 > Reports > Realtime Overview

  • Check "Event count by Event name" card and find abconvert_experience_impression events

Step 5: Register Custom Dimensions in GA4

GA4 won't display ABConvert's data until you tell it what to look for. You'll need to register three custom dimensions:

  1. In GA4, go to Admin > Data display > Custom definitions > Custom dimensions.

  2. Click Create custom dimension and add each of these:

Dimension name

Event parameter

ABConvert Experiment Name

abconvert_experiment_name

ABConvert Variant Name

abconvert_variant_name

ABConvert Assignment Reason

abconvert_assignment_reason

Please ensure the dimension scope is set to "Event" so that data from visitors participating in multiple experiments can be collected accurately.

Step 6: Build Segments to Compare Groups

Once data is flowing, you can isolate each experiment group and compare their behavior in GA4's Explore section:

  1. Open Explore and create a new User Segment.

  2. Add a condition: event name is abconvert_experience_impression.

  3. Add parameter filters, for example:

    • abconvert_experiment_name = Your Test Name

    • abconvert_variant_name = Variant A

  4. Apply this segment alongside a Control segment to compare results side by side.

Troubleshooting

Events aren't showing up in GA4?

Work through this checklist:

  • Is the ABConvert tracking script installed? Make sure the script is installed on your live theme and placed in the correct location within your theme file. If you're on a different theme or recently switched themes, you'll need to reinstall it.

  • Is there an active experiment running? ABConvert only sends data to GA4 while at least one experiment is active. If all experiments are paused or ended, no events will be sent.

  • Is your GA4 script loading? Open your browser console and run typeof gtag. If it returns undefined, your GA4 tag isn't loaded on the page and ABConvert can't send data without it.

  • Are events stuck in the queue? Open your browser's DevTools, go to Application > Session Storage, and look for the key abconvert.session.ga4.impression.queue. If there are events sitting there, it usually means GA4 isn't available on the page, or the next step below is the issue.

  • Is the metadata endpoint reachable? Visit https://app.abconvert.io/api/ga4/metadata in your browser. If it doesn't load, a browser extension or network setting may be blocking it.

Did this answer your question?