Set Up Clearbit with Google Analytics 4 and Google Tag Manager

Last Updated: December 2, 2022

For pricing information, please fill out the demo-request form on our pricing page to get in touch with a sales representative.

❗Disclaimer: You must be using Google Tag Manager for this setup to work. If you do not have GTM added to your site, do not continue with this guide. Also, if you're using a Google Analytics: Universal Analytics, use this set up guide instead.

Clearbit equips marketers with deep insights about their web traffic. Behind the scenes, Clearbit dynamically links IP addresses with specific companies and their relevant firmographics & technographics.
It's especially useful for the following use-cases:

  • Knowing which companies are browsing your site in real-time, even if they haven't submitted a form.
  • Determining attribution & conversion statistics for key accounts and target segments.
  • Customizing engagement for key accounts or company profiles (by size, vertical, or even tech stack).
  • Delivering dynamically personalized content to your site visitors.

Skip Ahead to:

Enable Reveal Data in Clearbit Platform

  1. Navigate to the Connections tab.
  2. Click Set up in the Clearbit Tag section.
  3. 2022-09-07_12-34-28.png
    Enable Reveal data by clicking on the toggle.

Create Custom Dimensions in Google Analytics 4

  1. To configure custom dimensions for Clearbit data in Google Analytics 4 (GA4), navigate to the Configure tab > Click Custom definitions > Click Custom dimensions > Click Create custom dimensions.GIF_Recording_2022-03-16_at_5.38.15_PM.gif
  2. Fill in the New custom dimension form by filling in the Dimension name field, selecting User in the Scope field, and fill in the User property field.GIF_Recording_2022-03-16_at_5.47.31_PM.gif
    Repeat the above steps for each attribute you want Clearbit to pass into GA, using the suggested values below for Dimension Name and User Property. You do not need to create dimensions for all of these attributes, but this suggested set includes the most popular attributes we offer.
    Dimension Name and User Property Values
    ClearbitTrafficType
    ClearbitCompanyName
    ClearbitCompanyDomain
    ClearbitIndustry
    ClearbitSubIndustry
    ClearbitSICCode
    ClearbitNAICSCode
    ClearbitHQCountry
    ClearbitHQState
    ClearbitHQCity
    ClearbitEstimatedRevenueRange
    ClearbitEmployeeRange
    ClearbitGlobalAlexaRank

Create Data Layer Variables in Google Tag Manager

  1. To create data layer variables in GTM, which are used to pass the Clearbit data into GA4, navigate to GTM, click the Variables tab, find the User-Defined Variables box, and click New.
    GIF_Recording_2022-03-16_at_5.59.58_PM.gif
  2. Fill in the data layer variable form by:
    GIF_Recording_2022-03-16_at_6.14.55_PM.gif
    • Replacing Untitled Variable with the suggested Variable Title below.
    • Clicking Variable Configuration, then Data Layer Variable.
    • Filling in Data Layer Variable Name with the value provided below.
    • Setting Data Layer Version to Version 2.
    • Checking the box for Set Default Value and fill it in as "(Non-Company)".
    • Under Format Value, checking the box for Convert false to... and filling it in as "(Non-Company)".
    • Clicking Save.
      Repeat the above steps for each attribute you want Clearbit to pass into GA.
      Variable Title Data Layer Variable Name
      ClearbitTrafficType reveal.type
      ClearbitCompanyName reveal.company.name 
      ClearbitCompanyDomain reveal.domain
      ClearbitIndustry reveal.company.category.industry
      ClearbitSubIndustry reveal.company.category.subIndustry
      ClearbitSICCode reveal.company.category.sicCode
      ClearbitNAICSCode reveal.company.category.naicsCode
      ClearbitHQCountry reveal.company.geo.country
      ClearbitHQState reveal.company.geo.state
      ClearbitHQCity reveal.company.geo.city
      ClearbitEstimatedRevenueRange reveal.company.metrics.estimatedAnnualRevenue
      ClearbitEmployeeRange reveal.company.metrics.employeesRange
      ClearbitGlobalAlexaRank reveal.company.metrics.alexaGlobalRank

Add the Clearbit Scripts to Google Tag Manager

  1. To create a custom HTML tag in GTM, which will be used to deploy the Clearbit tag to your site, navigate to the Tags tab, and click New.
  2. Fill in the tag form by:
    • Replacing Untitled Tag with "Clearbit Reveal".
    • Clicking Tag Configuration, and then clicking Custom HTML.
    • Pasting in two scripts:
      • First, paste in the revealCallback script provided below.
      • Second, paste in the Clearbit tag provided here.
    • Clicking Triggering, and then clicking All Pages.
    • Clicking Save.
  3. Toggle on Reveal Data here (do not toggle on Synchronous Reveal Data).
    GIF_Recording_2022-03-17_at_2.45.14_PM.gif

📝 Please note: The revealCallback script must be placed above the Clearbit tag, regardless if both are within GTM or not.

<script>
function revealCallback(response) {
var reveal = response;
window.reveal = reveal;
dataLayer.push({
event: "Clearbit Loaded",
reveal: reveal
});
};
</script>

Create a Custom Event Trigger in Google Tag Manager

  1. To create a custom event trigger, which will be used to ensure GA4 only fires on the page after Reveal has retrieved data for the visitor's IP address, navigate to the Triggers tab in GTM, and click New.
  2. Fill in the trigger form by:
    • Replacing Untitled Trigger with "Clearbit Loaded".
    • Clicking Trigger Configuration, then clicking Custom Event.
    • Filling in Event Name as "Clearbit Loaded".
    • Set the trigger to fire on "All Custom Events".
  3. Click Save.

Create a Google Analytics: GA4 Configuration Tag in Google Tag Manager

  1. To create a GA4 configuration tag in GTM, which adds the GA4 script to your site and maps the Reveal data into your GA4 custom dimensions, navigate to the Tags tab, and click New.
  2. Fill in the tag form by:
    GIF_Recording_2022-03-17_at_4.06.36_PM.gif
    • Replacing Untitled Tag with "Google Analytics 4".
    • Clicking Tag Configuration > Google Analytics: GA4 Configuration.
    • Filling in your GA4 Measurement ID.
      • You can find this in Google Analytics under AdminData Streams> Select the data stream you're working with > copy your ID from the top-right.
    • Under User Properties click Add Row, where you will create mappings between your data layer variables and GA4 custom dimensions:
      • On the left, enter the name of your GA4 custom dimension (e.g. ClearbitTrafficType).
      • On the right, enter the name of the corresponding data layer variable with a double curly braces syntax (e.g. {{ClearbitTrafficType}} ).
      • Repeat this step for each attribute you want passed into GA4.
    • Click on the Triggering box and select Clearbit Loaded.
    • Click SaveYou're finished!

📝 Please note: GA4 requires you to wait 24 hours before you can report on the data sent to your custom dimensions.