1. BetterKnowledge Base
  2. BetterBot Integrations

BetterBot Google Analytics 4 Integration

The below information is required for BetterBot to connect to Google Analytics 4

Background:

Google Analytics is transitioning from Universal Analytics to Google Analytics 4. To ensure accurate data reporting, please follow the steps below for seamless integration.

Data Layer Variable Setup:

To begin, you need to set up your data layer variable. A Data Layer Variable collects specific data from the data layer on a website. The data layer serves as a storage space for important information about user actions or interactions.

Please complete the following steps to set up the data layer variable:

  1. Log in to your company's Google Tag Manager.
  2. Go to the “Variables” section 
    21
  3. Under “User-Defined Variables” click on “New” 
    22
  4. Rename the variable to "BB eventCategory"
  5. Click on the "Variable Configuration" box to open the sidebar
  6. Scroll down to “Page Variables” and click on “Data Label Variable” 

    V1
  7. In the "Data Label Variable Name" field, type in "eventCategory."

    v2
  8. Click “Save”
  9. Repeat steps 5-8 to create "BB eventAction" and "BB eventLabel" variables.
    v4

  10. Once all three variables are created, click "Submit."
  11. Create a Verison Name and add a description. When it is completed click on "Publish" 
    publish1-1

eventTracking Trigger Configuration:

A trigger in Google Tag Manager monitors web pages or mobile apps for specific events such as form submissions, button clicks, or page views. When it detects one of these events, it triggers the associated tag to take action. Each tag requires at least one trigger to function properly.

Follow these steps to configure a trigger in GTM:

  1. Log into your company's Google Tag Manager
  2. Go to the "Triggers" section
    trigger section
  3. Create a new Trigger 
    16
  4. Rename the Trigger "eventTracking" and click on the "Trigger Configuration" box to open the sidebar
    17
  5. Under the “Other” section, select “Custom Event”
  6. Enter "eventTracking" in the Event Name field and click "Save."

  7. Click "Submit" and create a Version Name, add a description, then click "Publish."

  8. publish1-1

GA4 Configuration (optional)

This is optional if GA4 is already configured. If this is connected please skip down to BetterBot GA4 Tag

BetterBot GA4 Tag" section. The GA4 Configuration tag ensures smooth data flow from your website to Google Analytics. To collect analytics data, create a configuration tag on each page where data collection is required

To configure, please follow the steps below"

  1. Log into your company's Google Tag Manager.
  2. On the left side, select “Tags” 
  3. Create a new Tag 
  4. Rename your Tag and click “Tag Configuration”
  5. In the sidebar, select "Google Analytics: GA4 Configuration."
  6. Open your Google Analytics and navigate to Admin → Data Streams → Select Data Steam
  7. Copy the Measurement ID 
  8. Return to your Google Tag Manager and paste the Measurement ID code
  9. Click on the "Trigger Configuration" box to open the sidebar
  10. Select “All Pages” 
  11. Click "Save" when finished.


BetterBot GA4 Tag : 

The "Tags" section in GTM is where you manage all tracking tags. It simplifies the process of adding, configuring, and updating tracking codes without modifying the website's code directly. With its user-friendly interface, it streamlines the implementation and management of tags, giving you more control and flexibility over your tracking setup.

To configure the BetterBot GA4 Tag, follow these steps:

  1. Log in to your company's Google Tag Manager.
  2. On the left side, select “Tags”
  3. Create a new Tag1.-1
  4. Rename the Tag "BB GA4" and click on "Tag Configuration."
  5. A side pane will open to select the tag type. Select "Google Analytics GA4 Event"
  6. Under the "Configure Tag" drop-down, select "Google Analytics GA4 Configuration."
  7. In the Event Name field, enter "eventTracking."
    et1
  8. In the "Event Parameters" section, add three rows and fill in the following information:5-1
    1. Parameter Name: 
      1. event_category 
      2. event_action
      3. event_label
    2. Value: 
      1. BB event Category 
      2. BB event Action
      3. BB event Label 

    6-1
  9. In the "Trigger" Section, select "eventTracking trigger" and save your changes
    8-1
  10. Once the changes are saved, go back to the tags page and click "Submit."

    trigger4
  11. Create a Verison Name and add a description. When it is completed click on "Publish" 

    publish1-1
  12. Please make sure the last 2 steps are completed. If it is not "Published" the integration will not work
  13. BetterBot will check to see if the integration is connected