Fibr Support
  • Fibr Docs
  • Get Started
    • Intro to Fibr
      • What is Fibr?
      • What products does Fibr offer?
    • Account Settings
      • Inviting Your Team
    • Fibr Script
      • What is Fibr Script?
      • Configuring the Fibr Script for your website
      • Impact of Fibr Script on Website Performance
    • FAQs
      • How to Whitelist Fibr in Your Website’s Content Security Policy (CSP)?
      • Can You Run Fibr on Your Local Machine?
  • Fibr Testing
    • Intro to A/B Testing
      • How to Create an A/B Test in Fibr?
      • How do you create a bulk AB campaign?
    • Audience Selection
      • Define your Audience Segment
      • Location-based Segmentation
    • FAQs
      • What are Traffic Allocation and Traffic Split?
      • Can I change an experiment's configuration when it is running?
      • Can I Run Fibr Tests on a Website That Has Cookies Disabled?
      • Can I Run Fibr Tests on Sub-domains?
      • Scheduling a Campaign in Fibr
  • Fibr Personalization
    • Ad Personalization
      • How to create an Ad Personalization campaign?
      • How to create a bulk Ad Personalization campaign?
    • Audience Personalization
      • How to create an Audience Personalization campaign?
      • Defining the audience for Audience Personalization
      • Location-based Segmentation
      • How to create a bulk Audience Personalization campaign?
  • Fibr Editor
    • Using Visual Editor to Create Variants
    • Using Visual Editor to track events
    • Using Fibr Editor for Bulk Variant Creation
  • Metrics
    • How can I define metrics on Fibr?
    • How do the GTM metrics work on Fibr?
    • What is a Primary Metric?
  • Integrations
    • Integrating Fibr with Google Analytics 4
    • Integrating Fibr with Google Tag Manager
    • Integrating Fibr with Google Ads
    • Integrating Fibr with Meta Ads
Powered by GitBook
On this page
  • Deciding Your Method
  • Method 1: Using Google Tag Manager
  • Method 2: Using gtag.js
  • Setting up Custom Dimensions
  1. Integrations

Integrating Fibr with Google Analytics 4

Track your Fibr variations with GA4.

PreviousWhat is a Primary Metric?NextIntegrating Fibr with Google Tag Manager

Last updated 6 months ago

Fibr can send events to your Google Analytics 4 (GA4) instance whenever a visitor sees a personalized variation. This lets you view your Fibr data alongside all the other data you track in Google Analytics.

Deciding Your Method

Before you begin, you must decide which tracking method to 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 have Google Analytics set up directly, installing gtag.js on your site and configured for your GA4 Measurement ID, you can use the gtag.js tracking method and we will automatically send events to your GA4 instance.

Make sure you use only one of the two methods. Turning on both methods may result in duplicate tracking.

Method 1: Using Google Tag Manager

If you have set up your Google Analytics with Google Tag Manager, then this is the method for you. Fibr will push a dataLayer event whenever a user views an experience. Click here to read more on turning on the GTM integration and creating the data layer.

Once you have turned on the GTM integration and a data layer has been selected, follow the following steps to enable Fibr to send impression events to GA4 through GTM:

  1. After data layer creation, select the GA4 option on the next screen:

  2. Select the Measurement ID for which you want to create the tag. Selecting a single measurement ID is preferable even if you have multiple measurement IDs in your account.

  3. Once you select the measurement ID, we will create a new tag in your GTM with the following specifications:

    • Tag name: GA4 - Fibr Impression

    • Tag type - Google Analytics: GA4 Event

    • Measurement ID - {As specified by you}

    • Event Name: fibr_impression_event

    • Event parameters: All data layer variables

  4. Once the tag is created, you can go to your GTM dashboard and submit the version with the new Fibr tag to start tracking Fibr parameters in your GA4.

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 FIbr. Here are the steps you need to follow:

  1. Go to the integrations page on the Fibr dashboard and enable the Google Analytics integration

  2. Once turned on, we will find the GA4 property on your website and start sending a fibr_impression_event.

Setting up Custom Dimensions

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

  • fibr_session_id: The unique id of a visitor session

  • fibr_user_id: The unique user ID assigned to the visitor

  • fibr_variation_id: The unique ID of the variation that the user saw

  • fibr_variation_name: The name of the variation that the user saw

  • fibr_campaign_group_id: The unique id of the Personalization or Experiment to which the variation belongs

  • fibr_campaign_group_type: The campaign type. This can have 2 values:

    • Personalization: This specifies that the variation loaded was of a personalization

    • Experiment: This specifies that the variation loaded was of an experiment

  • fibr_campaign_group_name: The name of the Personalization or Experiment to which the variation belongs

  • fibr_campaign_name: The name of the campaign to which the variation belongs

  • fibr_campaign_id: The unique ID of the campaign to which the variation belongs

  • fibr_workflow_id: The workflow to which the campaign belongs

  • fibr_campaign_group_name: < Name of personalization or experiment >

  • fibr_client_id: This is a unique identifier for the client

  • fibr_is_qualified: This parameter is to determine whether the user qualified for a personalization or not

To effectively use Fibr events for reporting, 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 click "Custom definitions".

  2. Click on "Create custom dimension".

  3. You'll want to create a custom dimension for each of the abovementioned parameters. Here's an example for variation_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 abovementioned parameter.