For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set Up GA4 Integration

Depending on how your store has implemented Google Analytics, multiple integration methods are available. Google Tag Manager is the recommended method, as it provides the most reliable data flow and gives you full control over your analytics implementation.

If you use Elevar to manage your data layer, follow these instructions. The process is similar to the standard GTM setup with one key difference: you'll configure a trigger group that includes Elevar's user data event and the Shoplift event as distinct triggers.

Note: These are general instructions. We recommend working with Elevar's support team if you have a complex or customized setup.

Prerequisites

Before you begin, make sure you have:

  • A Google Tag Manager container with Elevar's configuration installed, including the dl_user_data event and associated triggers

  • Access to the Google Analytics property you want to connect

  • Permission to create Audiences in GA4 using the Google account you'll connect

  • Permission to publish changes to your GTM container

Step 1: Connect GA4 in Shoplift

Start by authorizing Shoplift to access your Google Analytics property:

  1. In Shoplift, navigate to Settings → Integrations

  2. Find the Google Analytics section and click Connect

  3. Sign in with the Google account that has access to your GA4 property

  4. When prompted, grant Shoplift permission to "Edit Google Analytics management entities" — this allows Shoplift to create audiences for your tests

  5. Set the integration type to "Google Tag Manager (recommended)"

  6. Select your GA4 account and property from the dropdowns and click Confirm

The integration will toggle on, confirming that Shoplift and GA4 are now connected.

Step 2: Create the Data Layer Variable in GTM

Shoplift pushes test data to the data layer using a variable called exp_variant_string. You need to create this variable in GTM so it can be passed to GA4:

  1. In Google Tag Manager, go to Variables

  2. Under User-Defined Variables, click New

  1. Name the variable exp_variant_string

  2. Click Variable Configuration and select Data Layer Variable

  1. In the Data Layer Variable Name field, enter: exp_variant_string

  2. Confirm the Data Layer Version is set to Version 2

  1. Click Save

Step 3: Create the GA4 Event Tag

Now create a tag that sends the experience_impression event to GA4:

  1. In GTM, go to Tags and click New

  2. Name the tag Shoplift - GA4 Event

  3. Click Tag Configuration and select Google Analytics: GA4 Event

  1. In the Measurement ID field, enter your GA4 Measurement ID (format: G-XXXXXXXXXX) — this should match the property you connected in Shoplift

  2. In the Event Name field, enter: experience_impression

  3. Expand Event Parameters and click Add Parameter

  4. Set the Parameter Name to: exp_variant_string

  5. For the Value, click the variable picker and select the exp_variant_string variable you created in Step 2

  1. Click Save

Step 4: Create a Trigger Group (Elevar-Specific)

Elevar requires a trigger group that combines the Shoplift event with Elevar's user data event:

  1. In the tag's Triggering section, click + to create a new trigger

  2. Choose Trigger Group as the trigger type

  3. Name the trigger User Data + Experience Impression

  1. Now we'll define the Triggers included in the Trigger Group. This will include a specific Experience Impression event trigger that we will create, and an Elevar-specific User Data event trigger which should already be created in your Tag Manager container.

  2. Click Choose a trigger. Create a new trigger by clicking the + icon in the top right.

  3. Name your trigger Shoplift - GA4 Event Trigger.

  4. Click Trigger Configuration and scroll down in the window until you see the Other section. Select Custom Event.

  1. In the Event name field, enter experience_impression

  1. Click Save

  2. Then add another trigger to the trigger group by clicking the + icon.

  3. Select the Elevar User Data event trigger, which will be called something like Event - user_data. To confirm you've selected the correct trigger, you can click into the Elevar trigger to look at it's configuration. The Trigger Type should be Custom Event and the Event name should be dl_user_data.

  1. Once selected, you will have two triggers in your trigger group.

Step 5: Save and Publish

  1. Click Save to save the trigger group

  2. Click Save to save the tag

  3. Click Submit and Publish in GTM

Click Submit in GTM, then Publish to push your changes live.

Your GTM container is now configured to receive events from Shoplift and forward them to GA4.

Step 6: Register the event as a custom dimension in Google Analytics

GA4 requires event parameters to be registered as custom dimensions before they can be used in reports. Here's how to set this up:

  1. In Google Analytics, click Admin (gear icon in the bottom left)

  2. Under your property, click Custom definitions

  3. Click Create custom dimension

  1. Configure the dimension:

    • Dimension name: exp_variant_string

    • Scope: Event

    • Event parameter: Select exp_variant_string from the dropdown

  1. Click Save

Note: If exp_variant_string doesn't appear in the Event parameter dropdown, it means GA4 hasn't received any events with this parameter yet. Launch a test in Shoplift and visit your store as a test participant, then return to this step. It may take up to 24 hours for new parameters to appear.

Once registered, the custom dimension will be available for use in Explorations within 24-48 hours.

If you've connected GA4 to your store through Shopify's built-in Google & YouTube sales channel, you can set up the Shoplift integration with minimal configuration.

Using Littledata for your GA4 Shopify connection? Follow the steps below - no additional set up is required.

Not using Littledata? Shoplift recommends it over the Google & YouTube sales channel. Learn more

Prerequisites

  • Google Analytics 4 connected to your store via the Google & YouTube sales channel

  • Access to the GA4 property to authorize the connection

  • Permission to create Audiences in GA4

Step 1: Authorize the connection

The Google & YouTube sales channel integration requires only the Shoplift authorization step—no tag manager configuration is needed:

  1. In Shoplift, navigate to Settings → Integrations

  2. Click Connect next to Google Analytics

  3. Sign in with the Google account connected to your GA4 property

  4. Grant Shoplift permission to "Edit Google Analytics management entities"

  5. Set "Google and YouTube Sales Channel" as the integration type

  6. Select your GA4 property from the dropdown

  1. Click Confirm

The integration will toggle on. Shoplift will now automatically create audiences for your tests and send visitor events to GA4.

Step 2: Register the event as a custom dimension in Google Analytics

GA4 requires event parameters to be registered as custom dimensions before they can be used in reports. Here's how to set this up:

  1. In Google Analytics, click Admin (gear icon in the bottom left)

  2. Under your property, click Custom definitions

  3. Click Create custom dimension

  1. Configure the dimension:

    • Dimension name: exp_variant_string

    • Scope: Event

    • Event parameter: Select exp_variant_string from the dropdown

  1. Click Save

Note: If exp_variant_string doesn't appear in the Event parameter dropdown, it means GA4 hasn't received any events with this parameter yet. Launch a test in Shoplift and visit your store as a test participant, then return to this step. It may take up to 24 hours for new parameters to appear.

Once registered, the custom dimension will be available for use in Explorations within 24-48 hours.

Ready to analyze your data in GA4? See View Test Data In GA4

Last updated

Was this helpful?