# LeadByte integration

> Learn how to connect LeadByte affiliate management with AnyTrack for conversion tracking and reporting. Set up postback URLs and event mapping to track affiliate conversions and optimize your campaigns.

## LeadByte Integration Overview

The integration between LeadByte and AnyTrack enables you to get the most out of your marketing efforts. By connecting both platforms, conversion data is automatically sent from LeadByte to AnyTrack, which in turn forwards it on to Google Ads, Facebook Conversion API or TikTok API - giving you real-time insights into how effective your campaigns are. With one click tracking set up through our simple setup wizard, capture more conversions without any extra effort! Automate repetitive tasks and save time while optimizing for better ROI results with this powerful platform combination.

<Prerequisites
  title="Before you begin"
  items={[
    { label: "You have an AnyTrack account with a paid subscription", done: true },
    { label: "You have an active Integrate LeadByte and AnyTrack.io for Streamlined Affiliate Mktg and ROAS account", done: true },
    { label: "The AnyTrack tracking tag is installed on your website", done: true },
  ]}
/>

> 📘 **Prerequisites**
>
> * Your form has been configured to to receive the AnyTrack `clickid`
> * The AnyTrack tag is in the head section of your website (where the forms are located)
> * You have updated your LeadByte POST URL to include the `c3` parameter.
> * Please review the LeadByte knowledge base article to learn more about the [LeadByte Integration with AnyTrack.](https://support.leadbyte.co.uk/hc/en-us/articles/360019624978-AnyTrack)

<br />

### How does the LeadByte AnyTrack integration work:

1. **Traffic**: When visitors land on your website, AnyTrack collects traffic source data and First Party data.
2. **Form submission**: When a visitor submits the form on your website, AnyTrack will automatically pass the AnyTrack `click_id` into the form.
3. **Conversion flow**: 
   1. When a visitor submits a form and is accepted, Leadbyte sends the `lead` event to AnyTrack.
   2. When the lead is validated, leadbyte sends a `completeregisration` event to AnyTrack
   3. When a lead is sold, leadbyte sends a `Purchase` event to AnyTrack.
4. **Conversion API:** As conversions happen, AnyTrack then sends your conversions to your **Ad Platforms' Conversion API**.

### Technical details

| Reference               | Value          | Information                                                                                                                                                                   |
| ----------------------- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Tracking Group          | `leadbyte`     | The Tracking Group reference can be used to activate <Glossary>AutoTag</Glossary>.                                                                                            |
| Subid Parameter         | `c3`           | The Subid Parameter used to pass the AnyTrack `click_id` to leadbyte api.                                                                                                     |
| Tracking Method         | `Webhook`      | -                                                                                                                                                                             |
| hidden field form token | `--CLICK-ID--` | You will need to create a hidden field in your form and add the default value `--CLICK-ID--` so that AnyTrack will automatically substitute the token with a click\_id value. |

### Standard Conversions

> 📘 **Good to know**
>
> If you are funneling your leads through a form provider such as Typeform, AnyTrack will trigger a Lead event.
>
> 📘 **Note**
>

| Event Name             | Details                                    | Data Source |
| :--------------------- | :----------------------------------------- | :---------- |
| `Lead`                 | When lead is accepted by LeadByte.         | Webhook     |
| `CompleteRegistration` | When a lead is valid and ready to be sold. | Webhook     |
| `Purchase`             | When a lead is sold to a buyer.            | webhook     |

### The LeadByte Webhook

The Webhook is fully pre-defined and ready to be implemented with your LeadByte account.

```http
https://t1.anytrack.io/xxxxxxx/collect/leadbyte
```

**Leadbyte webhook Payload example:**

Check line 39 for the c3 parameter and AnyTrack clickid

```json jso
{
  "count": 1,
  "index": 0,
  "callbackType": "LEAD-SOLD_UNSOLD",
  "record": {
    "campaign": {
      "name": "Campaign name",
      "reference": "1",
      "currency": "USD",
      "id": 1,
      "deliveryModel": "Hybrid"
    },
    "buyers": [
      {
        "name": "Lead buyer name",
        "reference": "12",
        "`revenue`": 260,
        "id": 31,
        "status": "Sold"
      }
    ],
    "lead": {
      "contactemail": true,
      "firstname": "John Doe",
      "county": "California",
      "source": "google",
      "ssid": null,
      "phone1": "7024888888",
      "sid": "1",
      "street1": null,
      "id": 4400320,
      "street2": null,
      "contactphone": true,
      "email": "johndoe@gmail.com",
      "optinurl": null,
      "received": "2023-05-29T07:10:09Z",
      "c1": null,
      "c2": null,
      "c3": "XXXXXXPkXHcuKgRM5NHep8dv7exre7T3a5",
    },
    "callbackReference": "AnyTrack (Purchases)",
    "deliveries": [
      {
        "reference": "any reference",
        "scheduleTime": "2023-05-29T07:10:10Z",
        "validResponse": true,
        "delay": 0,
        "rawResponse": "Lead Assigned",
        "requestUrl": null,
        "id": 51,
        "sentAt": "2023-05-29T07:10:10Z",
        "status": "Sent",
        "responseLabel": "Success"
      }
    ],
    "supplier": {
      "name": "The lead Supplier",
      "commission": 0,
      "id": 1,
      "payoutType": "Buyer Delivery Accept",
      "sid": "1",
      "status": "Buyer Rejection"
    }
  }
}
```

> ❗ ****
>
> The LeadByte integration requires that the AnyTrack Tracking Tag in the `head` section of your website or landing pages. Learn now to [Install the AnyTrack Tag](/docs/install-anytrack-tag) on your website.

## Setup Guide

### Step #1: Add LeadByte to your AnyTrack Account

1. Go to the catalog and search for LeadByte.
2. Now click on the leadbyte card and then Click on Install.

### Step #2: Connect your LeadByte account

1. Copy the predefined Postback URL
2. Go to your LeadByte account and open the settings.
   1. Go to webhooks
   2. Add a new webhook
   3. Select all available parameters
   4. Paste the AnyTrack Webhook URL
3. Save

### Step #3: Adjust the Conversion Event Mapping

The Event Mapping allows you to define which events to track and map them to Conversion Events you will forward to your Ads Integrations (ex: Facebook Conversion API)\ <br />

<Image align="center" className="border" border={true} src={readmeAsset1} />

<br />

<br />

## Checklist to verify your integration

* [ ] The AnyTrack tag is in the head section of the website where your leads submit their form.
* [ ] You have added a hidden field to your form: `c3` and default value `--CLICK-ID--`
* [ ] You have added the AnyTrack webhook in Leadbyte 
  * [ ] Trigger all events
  * [ ] Send all parameters, including the `c3` parameters
* [ ] You have tested the form and can see the `c3` parameter populated with a unique click\_id string (ex: `xZDGbrPkXHcuKgRM5NHep8dv7exre7T3a5`
* [ ] The Events are valid in the integration log

<br />

## Related Resources

- [FB Ads Affiliate Marketing](/docs/how-to-do-affiliate-marketing-on-facebook-ads)
- [Google Ads Affiliate Marketing](/docs/how-to-do-affiliate-marketing-on-google-ads)
- [Track Forms and Pass Click IDs](/docs/how-to-track-form-submission-and-pass-anytrack-clickid-to-an-affiliate-offer-link)

## FAQ & Troubleshooting

* ### Can I import past conversions into AnyTrack?
  No. AnyTrack can only ingest conversions that have been triggered following a visitor session on your website.
* ### I don't see the `c3` parameter in LeadByte?
  If you don't see the `c3` & clickid value parameter in Leadbyte, it means that the form you are using to collect the leads is not configured:
* [ ] Verify that you have added the hidden field (see instructions above)
* [ ] Verify that the `c3` parameter is passed to the LeadByte webhook (alongside the other lead parameter data)
* [ ] If you are using a form like \[doc:leadshook], \[doc:unbounce], \[doc:elementor] or \[doc:typeform], please review the corresponding guides.
* ### Can I use a different `subid` parameter than the one predefined by LeadByte?
  No. The parameter is `c3` and this is the parameter we parse the `click_id` from. If it's not present in the webhook payload, the conversion will not be tracked.
* ### Can I track conversions without the `click_id`?
  No. The `click_id` passed to the LeadByte lead data is required to track conversions.
* ### The Conversion Event Name is not what I am expecting, how can I change it?
    You can update the Event Mapping in the LeadByte Integration settings.
