- About the IPQS APIs
- Proxy & VPN Detection API
- Email Verification API
- Phone Number Validation API
- Malicious URL Scanner API
- Device Fingerprint API
- Mobile Device Fingerprinting SDK
- Gaming Fraud Detection SDK
- Dark Web Leak API
- Malware File Scanner API
- Request List API
- Fraud Reporting API
- Account Management APIs
- Bulk Validation CSV
- Allowlist Blocklist APIs
- Plugins Platforms Integrations
- IP Reputation Database
- IP Address Abuse Feed
- Email Verification Database
-
Custom Integrations
- Getting Started
- Authentication
- Refresh Secret
- IP & Proxy Checks
- Email Verification Checks
- Phone Number Validity Checks
- Device Tracker
- List Device Trackers
- Device Tracker Statistics
- Login Tokens
- Overview Statistics
- Recent Proxy Statistics
- Recent Email Statistics
- Fraud Reporting
- Retrieve Requests by ID
- Country List API Documentation
- Release Notes
About Device Tracking in Custom Integrations
This API allows you to request a new device tracker URL, which you can then use to embed a JavaScript fraud tracker into their domain.
API Request URL
Warning
You should only call this API server-side for security reasons.
You can use the following URL to request a new device tracker URL:
https://www.ipqualityscore.com/webhooks/ExampleIntegration/json/generate_device_tracker
Request Parameters
| Parameter | Description | Example Value / Format |
|---|---|---|
| key | Required. Your site's domain or the domain that requested this integration. | google.com |
| secret | Required. Your user's current secret created during the authentication process. | char(128) |
| domain | Optional. The domain this JavaScript/pixel will be placed on. If this parameter is not passed the domain will default to your primary domain. | varchar(256) |
| tracker_name | Optional. A small string to describe this tracker. | varchar(256) |
| force | Optional. Forces the system to create a new tracker. | bool string (true/false) |
Note
This API will return existing device trackers first before creating new ones. If the domain and tracker_name are identical to an existing device tracker, then that tracker will be returned. If you want to create a new tracker anyway, include force=true in your request. Keep in mind your account may have a limited number of trackers.
Response Parameters
The result of this API will provide you with both the tracking JavaScript link and the pixel link. You can use both, provided the pixel is wrapped in a NoScript tag.
Note
Only JSON responses are available from this API.
| Parameter | Description | Example Value / Format |
|---|---|---|
| message | Description of the status of this call. May contain errors if errors exist. | text |
| success | Boolean result of if the request was successful or not. | boolean |
| domain | The domain which these URLs can be used on. | varchar(256) |
| tracker | The unique authentication key for these tracker links. This can also be found in the URLs below. | char(256) |
| script_url | The URL to the device tracking JavaScript without the script open/closing tags. | string |
| pixel_url | The URL to the device tracking pixel without the img open/closing tags. | string |
// URL for this request.
$URL = 'https://www.ipqualityscore.com/webhooks/ExampleIntegration/json/generate_device_tracker';
// Configuration items for this request. NOTE: $secret will be user specific not application specific.
$key = 'example.com';
$secret = 'YOUR_API_KEY_HERE';
// The domain where these tracking links will be used on.
$domain = 'google.com';
// Prepare POST fields.
$fields = array(
'secret' => $secret,
'key' => $key,
'domain' => $domain
);
// Create CURL.
$curl = curl_init();
// Configure CURL
curl_setopt($curl, CURLOPT_URL, $URL);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_POST, 1);
// Set POST Parameters
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($fields));
// Fetch URL
$result = curl_exec($curl);
// GET response code.
$response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// Close CURL
curl_close($curl);
// Handle result.
if((int) $response_code === 200){
// JSON Decode
$output = json_decode($result, true);
// Was the request successful?
if($output['success'] === true){
echo '<script src="'.$output["script_url"].'"></script><noscript><img src="'.$output["pixel_url"].'" /></script>';
} else {
echo "Unable to generate tracking links.";
}
} else {
echo "There appears to be an unforeseen error. Please contact IPQualityScore support if this persists.";
}