# Installation
Use Snitcher's Spotter API to accurately identify the company behind an IP addresses in real-time, even remote or virtual team members. For example to customize the page based on the company viewing it.
# Generate a Spotter API token
You can generate a Spotter API token from the Integration Settings Page (opens new window) in your Snitcher dashboard. Please note that the domain of the website profile you generate the API token for will automatically be whitelisted for usage with the generated token.
The API token cannot be used from any other domain.
TIP
Spotter API tokens are publishable tokens, only your own domain is whitelisted for usage so they can be savely exposed on the client-side.
# Install on your website
The Snitcher tracking script (which is probably already installed on your website) contains all the logic required to make calls to the Spotter API. All you need to do to start using Spotter, is define your Spotter API token and provide a javascript callback function that should receive the identification data. You can do define this on the window.SpotterSettings
object.
Make sure you define your callback function before you configure the window.SpotterSettings
object, and make sure you define your window.SpotterSettings
object before the Snitcher tracking script is loaded.
Below is a sample code snippet to show how to configure Spotter, and a sample callback function to illustrate how you can work with the identification data:
<script>
function myCallback(identification) {
// We want to ignore 'isp' type identifications
if (identification && identification.type !== "isp") {
// The company was successfully identified!
var company = identification.company;
// You can use the company object to build your Spotter integration.
// Here are some commonly used attributes available on the company object:
//
// company.industry
// company.employee_range
// company.founded_year
// company.location
// company.emails
// company.phones
//
// For a full reference of all available company variables, see full company object:
console.log(company);
}
}
// Spotter API settings
window.SpotterSettings = {
token: "YOUR-API-TOKEN",
callback: myCallback,
};
</script>
WARNING
Make sure you define your callback function and set the window.SpotterSettings
object before your Snitcher tracking script is included.