All Collections
Integrations
Exporting Mutiny data
Integrating with Google Analytics 4
Integrating with Google Analytics 4

Track your Mutiny experiences with GA4.

Updated over a week ago

Mutiny can send events to your Google Analytics 4 (GA4) instance whenever a visitor sees a personalized experience. This enables you to view your Mutiny data along side all the other data you currently track in Google Analytics.

Deciding Your Tracking Method

Before you begin, you need to decide which tracking method you will use. If you already track your Google Analytics events through Google Tag Manager (GTM), you'll likely want to use the GTM tracking method. However, if you already have gtag.js installed on your site and configured for your GA4 Measurement ID, you can use the gtag.js tracking method and Mutiny will automatically send events to your GA4 instance. If you're unsure about your existing gtag.js installation, contact your analytics developer or email support@mutinyhq.com.

You should only use one of the tracking methods below. Turning on both integrations may result in duplicate tracking.

Tracking Method 1: Using Google Tag Manager

If gtag.js isn’t already installed on your site and configured for GA4, you can use Google Tag Manager (GTM) to send Mutiny events to GA4. Mutiny will push a dataLayer event whenever a user views an experience. First, turn on the GTM integration.

  1. Click on the Google Tag Manager card.

  2. Turn on the GTM integration.

Once you’ve turned on the GTM integration, you’ll need to build your GA4 tag in GTM. The video below will show you how to import a number of tags, triggers and variables to GTM that automatically tap into the dataLayer events and send data to GA4. If you’d rather build your tag custom, you can check out our GTM integration documentation here.

⚠️ Important: Be sure to select "Merge" in step 5. Selecting overwrite will overwrite your existing Google Tag Manager tags and may break your existing website functionality.

  1. Download the container JSON file here: Mutiny_GA4_GTM_Integration_v2.json

  2. Navigate to Google Tag Manager and click “Admin” and then “Import Container”.

  3. Select “Choose container file” and upload the file you downloaded in step 1.

  4. Choose a new workspace and name it however you’d like.

  5. Select Merge (not Overwrite) and then select “Rename conflicting tags, triggers and variables”. Your settings should look like this:

  6. After confirming your changes you’ll now see a new GA4 tag, a new trigger, and a number of new variables in your container.

  7. Click the tag (”GA4 - Mutiny Experience Impression”) and either select your existing configuration tag, or input your measurement ID. More information on where you can find your measurement ID can be found here.

  8. After previewing the changes to verify that everything is setup correctly, publish your container by clicking “Submit” in the top right hand corner.

Tracking Method 2: Using gtag.js

If you’ve verified that gtag.js is installed on your site and configured for GA4, you can turn on the integration within the Mutiny app.

  1. Click on the Google Analytics 4 card.

    3. Turn on the integration.

Setting up your custom dimensions

Whenever a user views an experience, we’ll send an event to GA4 called mutiny_experience_impression. That event will contain the following properties:

  • experience_id - The unique id for the experience the user saw.

  • experience_name - The name of the experience the user saw.

  • segment_name - The name of the Mutiny Segment.

  • personalized - This property is set to true if a user saw a personalized variant, and false if a user saw the control.

  • variation_name - The name of the variation a user saw.

  • variation_key - The unique ID of the variation a user saw.

  • experience_type - The experience type. This can contain one of these 4 values: on_page, component, redirect, and headless

Variation assignment is done before personalized/control assignment. This means that if a user sees the control, the variation_name and variation_key values will populate with the variation that a user would have seen if they had been assigned the personalized version. We recommend using the personalized value to denote whether or not a user saw the control or a personalized variant.

In order to effectively report on your Mutiny events, you'll need to set up custom dimensions in GA4 to capture the parameters that are being sent over.

  1. Navigate to your Google Analytics 4 instance, click on the gear icon in the bottom left, and then click on "Custom definitions".

  2. Click "Create custom dimension".

  3. You'll want to create a custom dimension for each of the parameters listed above. Here's an example for experience_id. The name and description can be set to what makes the most sense for your organization, but you'll want to be sure the event parameter matches the parameter noted above.

Verifying Your Integration

To verify that your data is coming in correctly, you can look in Google Analytics 4. If you just configured your integration, you'll likely see your data under the "Realtime" report. Navigate to your GA4 dashboard, and click on "Realtime" to view your data. Assuming users are actively seeing Mutiny experiences, you'll see the mutiny_experience_impression event under the "Event count by Event name report".

Depending on how long it takes your GA4 data to process, you'll eventually be able to see your mutiny_experience_impression event under the "Engagement > Events" report as well.


Don't be a stranger

If you have any questions, we’re here to help! Please feel free to contact us at any time, either through intercom chat or via support@mutinyhq.com.

Did this answer your question?