Getting started with clearbit.js

The clearbit.js snippet loads a client-side JavaScript library that makes it easy to send data from your website to Clearbit. With this library, you can send page views and custom person or company traits to Clearbit X.

 

 

Add the clearbit.js snippet to your website HTML

Copy the JavaScript snippet from the clearbit.js configuration page and paste it directly before the closing </head> tag in your website's HTML.
  
Next, add any domains that you'll be loading Clearbit tags on to the Allowed Referrers list. This is a security measure that will ensure your public API key won't be used on any other sites.
 
If you just want to send your web traffic to Clearbit X, you're all done! Clearbit will automatically identify which companies are visiting your site. Visit your Clearbit Companies Dashboard to see your live web traffic. 
If you want to be more precise about which known people (as opposed to which companies) are on your site at a given time, you'll want to identify your users.

 

Troubleshooting

The best way to troubleshoot clearbit.js is to take a look at your browser's developer console. The console allows you to write JavaScript and execute methods manually. You also can inspect the Network Tab in the developer console to view requests going from the browser to Clearbit's servers.

Are you loading clearbit.js?

Open the JavaScript console. Type in `clearbit` and hit enter.
 
clearbit-console-troubleshoot.gif  
If you see the data type being loaded, then it's working! Otherwise, it means that clearbit.js is not being loaded onto the website.

Have you listed your domain(s) in Allowed Referrers list?

The Allowed Referrers list tells Clearbit which domains to accept requests from. If it's not in this list, then Clearbit will not accept requests from that domain.

How do I open the JavaScript console in your debugger?

The JavaScript console is a part of a browser's developer tools. The console reveals syntax bugs and errors that may occur in your JavaScript code. Additionally, you may execute valid JavaScript by typing into the console. Most browser developer tools allow you to see request traffic as well.
You can display your browser's console by pressing the corresponding keys below:
  • Chrome: COMMAND+OPTION+J (Mac) or CTRL+SHIFT+J (Windows).
  • Firefox: COMMAND+OPTION+K (Mac) or CTRL+SHIFT+K (Windows) and then click on the Console tab.
  • Safari: COMMAND+OPTION+I (Mac) or CTRL+ALT+I (Windows) and then click on the Console tab.
  • IE: F12 and then click on the Console tab.

What's next?

Clearbit X is as good as the data you provide it. To level up your data:
After you've added your data sources, then: