Integrate Reveal Analytics to Google Analytics via gtag.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.

 

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  -

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-Property-Id"></script>

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-Property-Id');
</script>

Add the following Clearbit GA code to your site by inserting the script below the Google Analytics standard gtag snippet, which should look like the section above. 

Be sure to change the key in the 'authorization' param to the publishable key, and take care to adjust the mappings to reflect the custom dimensions in your own GA properties.

Please reach out to your CSM to enable the correct entitlement for gtag.js

<script src="https://reveal.clearbit.com/v1/companies/reveal?authorization=pk_YOUR_KEY&variable=reveal"></script>

<script>
let reveal_gtag_map = {
'send_page_view': false,
'custom_map': {
'dimension1': 'type',
'dimension2': 'companyName',
'dimension3': 'companyDomain',
'dimension4': 'companyIndustry',
'dimension5': 'companySubIndustry',
'dimension6': 'companyEmployeesRange',
'dimension7': 'companyEstimatedAnnualRevenue',
'dimension8': 'companyAlexaRank',
'dimension9': 'companyCity',
'dimension10': 'companyState',
'dimension11': 'companyCountry',
'dimension12': 'companySicCode',
'dimension13': 'companyTech'
}
}

// This line configures the tracking ID with the mapping
gtag('config', 'UA-Property-Id', reveal_gtag_map);

let reveal_data_map = {};
let nonCompany = "(Non-Company)";

if(reveal === null || reveal.company === null) {
reveal_data_map = {
'non_interaction': true,
'type': reveal ? reveal.type : nonCompany,
'companyName':nonCompany,
'companyDomain':nonCompany,
'companyIndustry':nonCompany,
'companySubIndustry':nonCompany,
'companyEmployeesRange':nonCompany,
'companyEstimatedAnnualRevenue':nonCompany,
'companyAlexaRank':nonCompany,
'companyCity':nonCompany,
'companyState':nonCompany,
'companyCountry':nonCompany,
'companySicCode':nonCompany,
'companyTech':nonCompany
};
}
else {
let company = reveal.company;
reveal_data_map = {
'non_interaction': true,
'type':reveal.type,
'companyName':company.name,
'companyDomain':company.domain,
'companyIndustry':company.category.industry,
'companySubIndustry':company.category.subIndustry,
'companyEmployeesRange':company.metrics.employeesRange,
'companyEstimatedAnnualRevenue':company.metrics.estimatedAnnualRevenue,
'companyAlexaRank':company.metrics.alexaGlobalRank,
'companyCity':company.geo.city,
'companyState':company.geo.state,
'companyCountry':company.geo.country,
'companySicCode':company.category.sicCode,
'companyTech':company.tech
};
}

gtag('event', 'Clearbit', reveal_data_map);
</script>

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