Set Up Reveal API with Google Tag Manager and the dataLayer

Last Updated: April 20, 2022

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

If you have a Reveal API subscription, you will be able to push Clearbit data to the dataLayer. To easily do so, you'll just need to create the following tag inside of GTM.

Skip Ahead to: 

Set Up Your Custom Dimension in Google Analytics

To create a set of custom dimensions within Google Analytics, you'll need to create a one-to-one mapping of Clearbit attributes to Google Analytics dimensions.

  1. Navigate to  Custom Definitions > Custom Dimensions in the Google Analytics Admin panel.
  2. Create a custom dimension for each of the properties you want to include, with a 'Scope' of 'Session'. Mark Active.

💡 Clearbit Tip: We recommend adding as many of relevant Clearbit dimensions from the beginning as you can so there aren't any gaps in your analytics. GA is not retroactive, so if your team thinks it may use some of this data in the future, it's best to go ahead and collect it if you have the dimension available. You can choose to create as many or as few dimensions as you think is helpful, however you can only have up to 20 in GA total. We recommend these for best practice:

  • Clearbit IP Traffic Type
  • Clearbit Company Name
  • Clearbit Company Domain
  • Clearbit Industry
  • Clearbit Sub Industry
  • Clearbit Employee Range
  • Clearbit Estimated Revenue Range
  • Clearbit HQ City
  • Clearbit HQ State
  • Clearbit HQ Country

Within GA's custom dimension settings, you can use 'Parked' to indicate any unused Custom Dimensions that may have been accidentally created or previously used. You can rename these fields however you'd like so long as they are not duplicated.

How To Create Tag Inside Google Tag Manager

  1. In Google Analytics set up your Custom Dimension.
    💡 Clearbit Tip:  We highly encourage you to also include the traffic type by adding "reveal.type" as a custom dimension. This allows our team to help ensure a correct implementation. This is very different from the "company type" attribute.

    Attribute dataLayer variable
    Clearbit - Traffic Type reveal.type
    Clearbit - Company Name reveal.company.name
    Clearbit - Company Domain reveal.company.domain
    Clearbit - Industry reveal.company.category.industry
    Clearbit - Sub Industry reveal.company.category.subindustry
    Clearbit - SIC Code reveal.company.category.sicCode
    Clearbit - NAICS Code reveal.company.category.naicsCode
    Clearbit - HQ Country reveal.company.geo.country
    Clearbit - HQ State reveal.company.geo.state
    Clearbit - HQ City reveal.company.geo.city
    Clearbit - Estimated Revenue Range reveal.company.metrics.estimatedAnnualRevenue
    Clearbit - Employee Range  reveal.company.metrics.employeesRange
    Clearbit - Global Alexa Rank reveal.company.metrics.alexaGlobalRank
  2. For each one of the custom dimensions above that you have created within Google Analytics, create a respective "Data Layer Variable" within Google Tag Manager.
    💡 Clearbit Tip: Here is an example for setting up Clearbit - Company name as a variable: The Data Layer Variable Name should use "reveal.company.name". The Default Value and format value ("Convert false to...") should be set to "(Non-Company)":
    Screenshot_2018-09-19_14.38.44.png
  3. Create a Custom Event trigger with the Event name of Clearbit Loaded. This will be referenced later on.
    Screen_Shot_2020-06-26_at_3.18.39_PM.png
  4. Create a Google Analytics Settings variable. Under More settings, we will map our Data Layer Variables to their respective Custom Dimensions. Be sure to update with the correct UA-Tracking ID and map the Data Layer variables to their corresponding Custom Dimension index inside of Google Analytics — the Dimension Values will be the same ones you created from Step 2.
    GTM_GA_SET_CD.png
  5. Select Tag on the left-hand menu and create the Google Analytics - Universal Analytics tag:
    Screenshot_2018-09-19_14.38.02.pngCheck the Triggering section to make sure the Custom Event trigger we created in Step 3 is there.
  6. Create a Clearbit Reveal Tag as displayed (copy-paste the text under the image and update with your key - this can be found in your dashboard under APIs):
    Screen_Shot_2020-06-26_at_3.22.53_PM.png

    📝  Please note: If you want to change the triggering for this tag later on for a non-standard setup, you can.
  7. Save and Deploy your GTM tag.
<script>
function pushToDataLayer(response){
var reveal = {reveal:response};
dataLayer.push(reveal);
dataLayer.push({event:"Clearbit Loaded"});
return true;
}
</script>
<script src="https://reveal.clearbit.com/v1/companies/reveal?authorization=pk_YOUR_KEY&callback=pushToDataLayer">
</script>