Integrate Google Analytics 4 and Demandbase Using the Page View Event

  • Updated

Context

The Demandbase Tag sends Company Profile Attributes to Custom Dimensions in Google Analytics 4 (GA4), enhancing B2B web traffic insights.

There are two ways to integrate Demandbase with GA4. This article covers the recommended method, which sends Demandbase custom dimensions through the GA4 page view event as user parameters. This method provides deeper insights for custom reporting in GA4..

Alternatively, you can use a Demandbase custom event for a simpler setup, but with limited reporting. It tracks account visits and frequency but doesn’t link Demandbase data to other GA4 custom events. See Integrate Google Analytics 4 and Demandbase Using a Custom Event.

Prerequisite/Preparation

You must have Google Analytics 4 Admin permissions.

Step 1: Ensure the Demandbase Tag is Deployed

If you have not deployed the Demandbase Tag to your website, see Deploy Demandbase One Tag.

Step 2: Ensure You Have GA4 and Google Tag Manager (GTM)

See the Google documentation to ensure you are using GA4 and GTM.

Step 3: Select the Demandbase Attributes to Capture

Demandbase has over 40 firmographic attributes you can use. See Reference: Firmographic Attributes Overview for Demandbase IP-API v3 (Updated Version).

Important: In GA4, the free version allows up to 25 event parameters (attributes). The paid version allows up to 100 event parameters. See Google's article [GA4] Event collection limits.

By default, Demandbase automatically adds the following 12 attributes:
Important: These attributes cannot be removed.

  1. Company ID
  2. Company Name
  3. Website
  4. Industry
  5. Sub Industry
  6. Employee Band
  7. Revenue Band
  8. Audience
  9. Audience Segment
  10. City
  11. State
  12. Country Name

Tip: You can also add account-level Demandbase fields, including CRM account-level fields. To access Demandbase fields, go to Settings_N.png Settings > Analytics > Fields. See Understanding Fields

Step 4: Add GA4 Integration in Demandbase Account Connector

  1. In Demandbase, from the left navigation bar, go to Settings_N.png Settings > Demandbase-Wide Settings > Account Connector, and click Create New Integration.
  2. From the Integration Name drop-down list, select Google Analytics 4.
  3. Click Create.
    GA4
  4. Enter your Google Measurement ID and click Next. See the Google documentation for information about your measurement ID.
  5. A Demandbase team member reviews the integration, then sends you an email notification upon approval. Once approved, go to Step 5.

Step 5: Edit Attributes in Demandbase Account Connector

  1. Click upper right three dots > Edit.
    GA Edit.png
  2. In the Field Configuration table, add or remove attributes.
    • To add an attribute, click Add Field at the bottom of the table. Under Select Field, select an attribute.
    • To remove an attribute you added, hover over the field name, click the gear icon that appears, and click Delete Field.
      Important: You cannot remove the 12 attributes automatically added by Demandbase.
  3. Click Activate.
    GA4 Activate 2.png

Step 6:  Set Up Variables in GTM

  1. In GTM, navigate to the GTM container with the GA4 property setup.
  2. From the left navigation bar, select Variables.
  3. Create a new variable for each Demandbase attribute from Step 5.
    Variable_Config.png
    Enter the following:
    • Name: Enter a variable name.
    • Variable Type: Data Layer Variable.
    • Data Layer Version: Version 2 with a default value of Non-Company Visitor.
    • Data Layer Variable Name: Each variable requires a specific name from the Demandbase API response. Enter the following for the Demandbase attributes:
      • company_id
      • company_name
      • web_site
      • industry
      • sub_industry
      • employee_range
      • revenue_range
      • audience
      • audience_segment
      • city
      • state
      • country_name
        Tip: For data layer variable names to use with other firmographic attributes, see the Data Layer Variable Name column for each attribute in Demandbase Account Connector (Step 5).

Step 7: Add Demandbase Variables to the Existing Google Tag

  1. In GTM, from the left navigation bar, select Tags.
  2. Locate your domain’s existing Google Tag, which is used to fire the GA4 page view event (previously known as the GA4 Configuration Tag).
    Step 7_2.png
  3. Go to Shared event settings section, and under Event Settings Variable, select New Variable.
    Step 7_3.png
  4. Add the following Demandbase variables:
    • Variable Label: Add a name for the group of variables. For example, Demandbase Variables.
    • Google Analytics User Properties: Add a property row for each GTM variable created for the Demandbase attributes. 
      • In the Property Name field, enter a user property name for each custom Demandbase variable created in Step 6. The recommended names for each attribute are as follows:
        Important: You can use any property name, but the names entered here must match the user property name you create in Step 8. 
        • db_company_id
        • db_company_name
        • db_website
        • db_industry
        • db_sub_industry
        • db_employee_range
        • db_revenue_range
        • db_audience
        • db_audience_segment
        • db_city
        • db_state
        • db_country_name
      • In the Value field, click the plus icon and select the corresponding GTM variable created for each Demandbase attribute in Step 6.
        Step 7_4.png
  5. Click Save. The configuration appears in the Event Settings Variable field.
    Step 7_5.png
  6. Go to Advanced Settings section, and under Tag firing options, select Once per page.
    Step 7_6.png

Step 8: Update Google Tag Trigger

To ensure that Demandbase data is available before the GA4 page view event fires, you need to update the Google Tag trigger to provide sufficient time for the data to be available. 

Important: If your Google Tag trigger is currently based on a consent manager policy or if you have questions about changing the timing of your existing Google Tag trigger, contact your Demandbase Account Team. We can provide instructions on how to update your Google Tag trigger.

  1. In the Google Tag updated in Step 7, remove all existing triggers.
  2. Create a new trigger, and under Trigger Type, select Custom Event.Trigger_Config.png
  3. In the Trigger Configuration window, enter the following:
    • Event name: Demandbase_Loaded.
    • The trigger fires on: All Custom Events.
  4. Click Save.
  5. Create a second new firing trigger, and under Trigger Type, select Timer.
  6. For the trigger label, enter GA4 Timer.
  7. Enter the following:
    • Event Name: gtm.timer.
    • Interval: 2500.
    • Limit: 1.
    • Under Enable this trigger when all of these conditions are true, enter Container ID, contains, and your GTM Container ID.
      Tip: The GTM Container ID can be found in your GTM workspace, near the top, formatted as GTM-XXXXX.
      Step 8_7.png
  8. Click Save.
  9. After you create and save both triggers, they appear at the bottom of your GA4 Google Tag (page view event).
    Step 8_8.png

Step 9: Set Up Custom Dimensions in GA4

In GA4, set up Custom Dimensions to match your attributes in Demandbase.

  1. In GA4, go to the desired GA4 Property.
  2. From the left navigation bar, go to Data display > Custom definitions.
  3. On the Custom dimensions tab, click Create custom dimensions.
    Step 9_2 new.png
  4.  Create a custom dimension for each Demandbase attribute from Step 5.
    Step 9_3.png
    Enter the following:
    • Dimension name: Enter a name for the dimension to reference the Demandbase attribute. For example, Demandbase - Company Name.
    • Description: (Optional) Enter a description to add details for the dimension.
    • Scope: User.
    • User property: This is the most important field when you create custom dimensions. Ensure the values entered match the values used in Step 7. The recommended names for each attribute are as follows:
      • db_company_id 
      • db_company_name
      • db_website
      • db_industry
      • db_sub_industry
      • db_employee_range
      • db_revenue_range
      • db_audience
      • db_audience_segment
      • db_city
      • db_state
      • db_country_name

Was this article helpful?

1 out of 1 found this helpful