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.
- Company ID
- Company Name
- Website
- Industry
- Sub Industry
- Employee Band
- Revenue Band
- Audience
- Audience Segment
- City
- State
- Country Name
Tip: You can also add account-level Demandbase fields, including CRM account-level fields. To access Demandbase fields, go to Settings > Analytics > Fields. See Understanding Fields.
Step 4: Add GA4 Integration in Demandbase Account Connector
-
In Demandbase, from the left navigation bar, go to
Settings > Demandbase-Wide Settings > Account Connector, and click Create New Integration.
- From the Integration Name drop-down list, select Google Analytics 4.
- Click Create.
- Enter your Google Measurement ID and click Next. See the Google documentation for information about your measurement ID.
-
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
- Click upper right three dots > Edit.
- 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.
- Click Activate.
Step 6: Set Up Variables in GTM
- In GTM, navigate to the GTM container with the GA4 property setup.
- From the left navigation bar, select Variables.
-
Create a new variable for each Demandbase attribute from Step 5.
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
- In GTM, from the left navigation bar, select Tags.
- Locate your domain’s existing Google Tag, which is used to fire the GA4 page view event (previously known as the GA4 Configuration Tag).
- Go to Shared event settings section, and under Event Settings Variable, select New Variable.
- 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.
- 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:
- Click Save. The configuration appears in the Event Settings Variable field.
- Go to Advanced Settings section, and under Tag firing options, select Once per page.
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.
- In the Google Tag updated in Step 7, remove all existing triggers.
- Create a new trigger, and under Trigger Type, select Custom Event.
-
In the Trigger Configuration window, enter the following:
- Event name: Demandbase_Loaded.
- The trigger fires on: All Custom Events.
- Click Save.
- Create a second new firing trigger, and under Trigger Type, select Timer.
- For the trigger label, enter GA4 Timer.
- 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.
- Click Save.
- After you create and save both triggers, they appear at the bottom of your GA4 Google Tag (page view event).
Step 9: Set Up Custom Dimensions in GA4
In GA4, set up Custom Dimensions to match your attributes in Demandbase.
- In GA4, go to the desired GA4 Property.
- From the left navigation bar, go to Data display > Custom definitions.
-
On the Custom dimensions tab, click Create custom dimensions.
-
Create a custom dimension for each Demandbase attribute from Step 5.
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