# Lead Forensics integration

Lead Forensics identifies visiting companies by matching visitor IP addresses to their proprietary business IP database. This enables recognition of company visitors even without form submissions, which can then be leveraged in AB Tasty for targeted campaigns.

This integration enables powerful B2B personalization by revealing anonymous site visitors and passing company-level data to AB Tasty as custom variables. This approach can unlock high-impact campaigns and help shorten sales cycles

## Important consideration before you start

* **Accuracy**: IP-based recognition has limitations, especially with remote work and VPNs. Expect 20–40% match rates
* **Privacy**: Ensure GDPR and data protection compliance. Avoid using personal data without explicit consent
* **Timing**: Verify Lead Forensics data is available before AB Tasty evaluates targeting rules

## Implementation

{% stepper %}
{% step %}

#### Install Lead Forensics Script

Add the Lead Forensics tracking code to your website following their documentation
{% endstep %}

{% step %}

#### Expose Lead Forensics Data

Lead Forensics exposes company/IP information via global variables or callbacks:

```
javascriptUnwrapCopywindow.leadForensicsData = {
  companyName: "Acme Corp",
  companyId: "12345",
  ip: "1.2.3.4",
  industry: "Software"
  // ...other fields
};
```

{% endstep %}

{% step %}

#### Push Data to AB Tasty

Use AB Tasty's API to send the Lead Forensics data as custom variables:

```
javascriptUnwrapCopyif (window.leadForensicsData) {
  ABTasty.API.addGlobalData('leadForensicsCompany', window.leadForensicsData.companyName);
  ABTasty.API.addGlobalData('leadForensicsCompanyId', window.leadForensicsData.companyId);
  ABTasty.API.addGlobalData('leadForensicsIndustry', window.leadForensicsData.industry);
}
```

{% endstep %}

{% step %}

#### Create Targeted Campaigns

In AB Tasty's campaign builder, add targeting conditions using the custom variables. For example, trigger campaigns when `leadForensicsCompany` equals "Acme Corp" or `leadForensicsIndustry` equals "Software".
{% endstep %}

{% step %}

#### Display Personalized Content

Use the data in your AB Tasty variation code:

```
javascriptUnwrapCopyvar company = ABTasty.API.getGlobalData('leadForensicsCompany');
if (company === "Acme Corp") {
  // Show special offer or content
}
```

{% endstep %}
{% endstepper %}

## Exemple

**Goal**: Show custom banners to target accounts

**Implementation**:

1. Lead Forensics identifies the visitor from "BigBank PLC"
2. The company name is pushed to AB Tasty
3. AB Tasty campaign targets `leadForensicsCompany === "BigBank PLC"`
4. Visitor sees personalized message: "Welcome BigBank team! Here's an exclusive offer for you."

## Troubleshooting

* Confirm Lead Forensics data loads before AB Tasty scripts execute
* Verify variables are correctly added via `ABTasty.API.addGlobalData`
* Double-check targeting logic and campaign values


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/integrations/custom-integrations/lead-forensics-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
