How do I integrate Reveal into Google Analytics (analytics.js)?

 

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.
* Reveal currently comes with a Google Analytics integration out of the box and takes all of 15 minutes to get up and running!

To see guides on best practices, head here.

 

Setup the analytics.js JavaScript snippet

If you don't already have google analytics set up on your site, you'll need to do the following. If you already have this on your site, you can skip this section.

You'll use the JavaScript snippet below to set up Google analytics. This should be placed in the <head> tag of your page. You'll need to replace the UA-#####-Y account ID below with your respective GA property ID.

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga
('create', 'UA-#####-Y', 'auto');
ga('send', 'pageview');
</script>

 

Create Custom Dimensions in GA

If you haven't already, step one is to configure custom dimensions for Clearbit data within Google Analytics. See the guide on creating custom dimensions here.

 

Adding the Clearbit Reveal Snippet

Next, you'll add the following code snippet to your site directly below the section above.

You'll need to replace the UA-#####-Y account ID below with your GA property ID, and replace pk_YOUR_KEY in the 'authorization' param of the second script to your publishable key. Finally, you will want to adjust the mappings to match your Custom Dimension configuration in Google Analytics.

 

<script>
ga(function(){
ga_trackers=[]; ga.getAll().forEach(function(x,i){ ga_trackers.push(x.get('name'))}); ga_trackers.forEach( function(gaName){ ga(gaName + '.require', 'Clearbit', {"mapping":{
"type":"dimension1",
"companyName":"dimension2",
"companyDomain":"dimension3",
"companyIndustry":"dimension4",
"companySubIndustry":"dimension5",
"companyEmployeesRange":"dimension6",
"companyEstimatedAnnualRevenue":"dimension7",
"companyAlexaRank":"dimension8",
"companyCity":"dimension9",
"companyState":"dimension10",
"companyCountry":"dimension11",
"companySicCode":"dimension12",
"companyTech":"dimension13",
"companyTags":"dimension14" }
}); });
});
</script>
<script async src="https://ga.clearbit.com/v1/ga.js?authorization=pk_YOUR_KEY">
</script>

 

Check out how to: Build a GA Dashboard with Clearbit Reveal Data