Install Clearbit JavaScript

Last Updated: March 8, 2024

Clearbit JavaScript is a snippet that identifies companies and people who visit your website. You can add the snippet directly to your website or use Google Tag Manager.

Skip Ahead to: 

Install Clearbit JavaScript on your website

  1. In your Clearbit account, in the left sidebar menu, navigate to Integrations.
  2. In the Analytics & Alerts section, next to Clearbit JavaScript click Manage.manage.png

    📝 Please note: if you don't have Integrations on your menu, navigate to Settings. Then, click Clearbit JavaScript

  3. Click the Copy icon. 
    copy-icon.png
  4. In your website’s HTML, paste the snippet before the closing </head> tag.

📝 Please note: while Clearbit loads synchronously, the tags it manages are appended asynchronously by default.

Set your allowed referrers

After you install the snippet, add the domains and subdomains that you want Clearbit to track to the Allowed Referrers section. This is a security measure that will ensure your public API key won't be used on any other sites. If you want to create an audience based on page views of a subdomain, add the subdomain in this section.

📝 Please note: you don't need to list specific paths or wildcards.

To add domains and subdomains to the Allow Referrers section:

  1. Enter the domain or subdomain in the text field and click Enter or Return on your keyboard.
  2. To remove a domain or subdomain, click the X next to the domain.
  3. Once you have finished adding your domains and subdomains, click Save.

x-allowed-referrers.png

Install Clearbit JavaScript with Google Tag Manager

  1. Navigate to Google Tag Manager, and choose the name of your container to create a custom Clearbit HTML tag.
  2. If you are using the Clearbit Google Analytics integration, choose the container with your Analytics tag.
  3. Create a New Tag and name it. 
  4. Select the Custom HTML tag option.

    Screen_Shot_2019-05-27_at_9.58.20_PM.png

  5. In your Clearbit account, navigate to the Clearbit JavaScript configuration page and click the Use Google Tag Manager tab.
    GTM-code.png
  6. Click the Copy icon.
  7. Navigate to Google Tag Manager and paste the script in the HTML section of your Custom HTML tag.
  8. In the Triggering section select All Pages.
  9. Click Save.

GTM-tag.png

Verify that your Clearbit JavaScript is working

Once the Clearbit JavaScript is live on your website and you have saved your Allowed Referrers, Clearbit will automatically identify and track the companies visiting your site.

To verify that the Clearbit JavaScript is receiving data:

  1. In your Clearbit account, navigate to the Clearbit JavaScript configuration page
  2. Click Test Integration. If the JavaScript is working, a Receiving data checkmark will appear.

receiving-data.png

 

3. To verify that the tag is actively revealing IPs on your website, in your Clearbit account, in the left sidebar menu, navigate to Companies to review your live web traffic. Companies with recent Last Path and Last Visit At activity indicate the tag is actively revealing IPs on your website.

companies.png

Track your website visitors

To reveal and track individuals on your website (as opposed to just companies) you need to identify your users. To do this, you can implement Identify calls on your web forms with Marketo or HubSpot, which will allow Clearbit to track users.

Prevent the Clearbit JavaScript from firing on specific Pages or for employees

You can configure the Clearbit JavaScript so that it doesn’t fire on every page within your domain. You can also prevent it from firing for internal employees that view your website so that it doesn't get counted as a Monthly Unique Visitor. Both of these goals can be accomplished by modifying your implementation on your website. For example, if you are using Google Tag Manager, you can easily set up page view filters to define when the script is or is not loaded on the website:

You can also use Google Tag Manager filters to prevent the tag from loading when one of your employees is on your website by pushing a Variable or sending an Event to the dataLayer and using that information to prevent the Clearbit JavaScript from deploying (e.g. if Employee = True, then do not deploy).

Related Articles