Setting Up Reveal with Google Analytics 4 and Google Tag Manager

Note: 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. To see other ways of setting up Reveal with the older GA Universal Analytics, head here.

 

How Can Reveal Help Me?

Reveal equips marketers with deep insights about their web traffic. Behind the scenes, Reveal 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.

 

Create Custom Dimensions in Google Analytics 4

Screen_Shot_2021-10-07_at_11.31.07_AM.png

Step one is to configure custom dimensions for Clearbit data in Google Analytics 4.

  1. In GA4, navigate to Configure > Custom definitions > Custom dimensions > Create custom dimensions.
  2. Fill in the New custom dimension form:
    • Fill in Dimension name.
    • Select User as the Scope.
    • Fill in User property.

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
ClearbitTrafficType
ClearbitCompanyName
ClearbitCompanyDomain
ClearbitIndustry
ClearbitSubIndustry
ClearbitSICCode
ClearbitNAICSCode
ClearbitHQCountry
ClearbitHQState
ClearbitHQCity
ClearbitEstimatedRevenueRange
ClearbitEmployeeRange
ClearbitGlobalAlexaRank

 

Create Data Layer Variables in Google Tag Manager
Screen_Shot_2021-10-07_at_12.13.33_PM.png
Next you need to create data layer variables in GTM, which are used to pass the Clearbit data into GA4.
  1. In GTM, navigate to VariablesUser-Defined Variables > New.
  2. Fill in the data layer variable form:
    • Replace Untitled Variable with the suggested Variable Title below.
    • Click Variable ConfigurationData Layer Variable.
    • Fill in Data Layer Variable Name with the value provided below.
    • Set Data Layer Version to Version 2.
    • Check the box for Set Default Value and fill it in as (Non-Company).
    • Under Format Value check the box for Convert false to... and fill it in as (Non-Company).
    • Click 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 Reveal Script to Google Tag Manager

Screen_Shot_2021-10-14_at_10.06.56_AM.png

Next you need to create a custom HTML tag in GTM, which will be used to deploy the Reveal JavaScript snippet to your site.

  1. In GTM, navigate to Tags > New.
  2. Fill in the tag form:
    • Replace Untitled Tag with Clearbit Reveal.
    • Click Tag Configuration > Custom HTML.
    • Paste in two scripts:
      • First, paste in the revealCallback script provided below.
      • Second, paste in the Reveal script provided here.
    • Click TriggeringAll Pages.
    • Click Save.
  3. Toggle on Reveal Data here (do not toggle on Synchronous Reveal Data).

Note: If you have already added this Reveal script to your site, then all you need to do is add this revealCallback script above the existing Reveal script on your site.

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

 

Create a Custom Event Trigger in Google Tag Manager

Screen_Shot_2021-10-07_at_12.42.26_PM.pngNext you need 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.

  1. In GTM, navigate to Triggers > New.
  2. Fill in the trigger form:
    • Replace Untitled Trigger with Clearbit Loaded.
    • Click Trigger Configuration > Custom Event.
    • Fill in Event Name as Clearbit Loaded.

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

Screen_Shot_2021-10-07_at_12.51.31_PM.png

Finally, you need 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.

  1. In GTM, navigate to Tags > New.
  2. Fill in the tag form:
    • Replace Untitled Tag with Google Analytics 4.
    • Click Tag Configuration > Google Analytics: GA4 Configuration.
    • Fill in your GA4 Measurement ID.
      • You can find this in GA4 under Admin Data 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 Triggering > Clearbit Loaded.
    • Click Save.

That completes the setup! However, note that GA4 requires you to wait 24 hours before you can report on the data sent to your custom dimensions.