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
- Set your allowed referrers
- Install Clearbit JavaScript with Google Tag Manager
- Verify that your Clearbit JavaScript is working
- Track your website visitors
- Prevent the Clearbit JavaScript from firing on specific pages or for employees
Install Clearbit JavaScript on your website
- In your Clearbit account, in the left sidebar menu, navigate to Integrations.
-
In the Analytics & Alerts section, next to Clearbit JavaScript click Manage.
📝 Please note: if you don't have Integrations on your menu, navigate to Settings. Then, click Clearbit JavaScript.
- Click the Copy icon.
- 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:
- Enter the domain or subdomain in the text field and click Enter or Return on your keyboard.
- To remove a domain or subdomain, click the X next to the domain.
- Once you have finished adding your domains and subdomains, click Save.
Install Clearbit JavaScript with Google Tag Manager
- Navigate to Google Tag Manager, and choose the name of your container to create a custom Clearbit HTML tag.
- If you are using the Clearbit Google Analytics integration, choose the container with your Analytics tag.
- Create a New Tag and name it.
-
Select the Custom HTML tag option.
-
In your Clearbit account, navigate to the Clearbit JavaScript configuration page and click the Use Google Tag Manager tab.
- Click the Copy icon.
- Navigate to Google Tag Manager and paste the script in the HTML section of your Custom HTML tag.
- In the Triggering section select All Pages.
- Click Save.
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:
- In your Clearbit account, navigate to the Clearbit JavaScript configuration page.
- Click Test Integration. If the JavaScript is working, a Receiving data checkmark will appear.
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.
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:
- GTM Page View Triggers documentation
- Training Video Example (the example uses a referrer, but you could easily Page URL or Page Path)
Related Articles