# Conversion tracking via API to affiliate networks

On this page, you'll find descriptions of Keitaro, and affiliate landing page integrations for lead passing via API.

The setup typically involves in two stages:

  • Adjusting the landing page files;

  • A global postback is configured in the affiliate program using the postback URL template from Keitaro. In some cases, the postback is set up not globally, but at the flow level to which the downloaded landing page is linked.

The main issue during setup is the incorrect passing of the subid parameter, which prevents Keitaro from receiving a proper postback. The document provides examples of landing page setups from various affiliate programs.

# Adcombo

Download the required landing page from the affiliate program interface. The landing page is set up to work with the API. You need to make a few minor changes to index.php to pass the subid.

Open index.php (or index.html) and add another line in the input parameters:

<input type="hidden" name="clickid" value="{subid}">
1

Save the index file, place the landing files in a zip archive, and upload it to the tracker.

Make sure to configure the postback by using the ready-made URL provided in the Adcombo templates within the tracker.

# Dr.Cash

Different API handlers are available in the affiliate program:

By default, JavaScript code is used. To configure it, you need to change the structure.

sub1: drlead.queryGet("sub1")
1

To:

sub1: "{subid}",
1

In the code:

If PHP code is used for processing, then change it from:

'sub1' => $_GET['sub1'],
1

To:

'sub1' => $_POST['sub1'],
1

In the data array Fields to send

Next, insert a line in the index to fill in the parameter:

<input type="hidden" name="sub1" value="{subid}"/>
1

# HotPartners

Request the necessary landing page from the manager, which must be configured for API. Ensure that the archive includes all the necessary files for correct form submission: index.php, send.php, and success.html.

Open index.php and in each form, add a line with input parameters:

<input type="hidden" name="sub_id1" value="{subid}">
1

Save the changes and then edit send.php

In the list of parameters $data = array(, change the first line to:

'sub_id' => empty($_REQUEST['sub_id1']) ? '' : $_REQUEST['sub_id1'],
1

Save, place the landing files in a zip archive, and upload it to the tracker.

As a final step, copy the postback URL from the affiliate network templates in the tracker and add it to the HotPartners affiliate network.

# KMA

To set up the transmission of subid on landing pages from KMA, you only need to add one line in index.html.

Open index.html and add the subid parameter to the form:

<input type="hidden" name="data1" value="{subid}">
1

After that, save the landing page files and upload them to the tracker as a zip archive. Don’t forget to retrieve the Postback URL from the affiliate network templates available in Keitaro and configure it in the KMA affiliate network.

# Leadtrade

To set up the affiliate network, you need to define the input parameters in the order forms so that when clicking the buttons on each form, the value of subid is also sent.

In the editor's search, find the <form> tag.

The data within the tag, including attributes and classes, varies on each landing page but is not relevant in this case.

Add a line for the click ID parameter, where the affiliate network retrieves the click ID. For Leadtrade, the parameter is subid1

<input type="hidden" name="subid1" value="{subid}">
1

Save it in an archive and add the archive to the tracker.

# Leadvertex

To set up the landing page from the affiliate network Leadvertex, you need to make adjustments to the index and send files.

Open index.html and add the subid parameter to the input parameters in the order form:

<input type="hidden" name="subid" value="{subid}"/>
1

Save the changes and then edit send.php. Find the line:

'utm_term' => $utm['utm_term'],
1

Change it to:

'utm_term' => $_POST['subid'],
1

Save the changes.

# LemonAD

Go to the offer page and download the necessary landing page.

In the index.php file, find the <form> tag.

In the action field, insert the value lemon.php.

Place the following code inside the form and save the file:

<input type='hidden' name='utm_source' value='<?= $_GET['utm_source'];?>'>
<input type='hidden' name='utm_content' value='<?= $_GET['utm_content'];?>'>
<input type='hidden' name='utm_campaign' value='<?= $_GET['utm_campaign'];?>'>
<input type='hidden' name='utm_term' value='<?= $_GET['utm_term'];?>'>
<input type='hidden' name='utm_medium' value='<?= $_GET['utm_medium'];?>'>
<input type='hidden' name='clickid' value='{subid}'>
1
2
3
4
5
6

In the offer code:

Save the file and upload it to the tracker in the offers section, or save the changes in the Keitaro editor.

# LuckyOnline

Download the necessary landing page from the affiliate program and copy the hash in the stream settings.

Next, edit the index.html file.

Open the file and find the line with the hash, write the previously copied hash value, and add the parameter for passing subid next to it:

subid: '{subid}'
1

Save the index.html file and upload the landing archive to the tracker.

Configure the postback globally in the account settings.

# M1-Shop

Download the landing page. Open index.html.

Add the subid output to the form:

<input name="subid" type="hidden" value="{subid}">
1

Find the order submission function and add subid to the existing parameters:

function sendData(client_name, client_phone, subid)
1

In the section of code where the request is sent, place subid next to s:

In the function call code, add the following line:

$('input[name=subid]', this).val()
1

# M4Leads

To set up the landing page from the M4Leads affiliate network, you need to make adjustments in the index, and order files.

Open index.html and add the subid parameter to the input parameters in the order form:

<input type="hidden" name="sub_id[0]" value="{subid}">
1

Save the changes and then edit order_ru.php.

Find the line $sub_id = and change it to the following:

$sub_id = !empty($_POST['sub_id']) ? $_POST['sub_id'] : array();
1

Save the changes. Place the files in a zip archive and upload them to the tracker.

In the settings of the M4Leads affiliate network, configure the global postback and set the transmission method to GET.

# Shakes.pro

To configure the offer, you need to make changes to the index, and order files.

In index.html, find the forms and add a line to pass the click subid from the tracker.

<input type="hidden" name="sub1" value="{subid}" />
1

Save the changes and then edit order.php.

Replace the line:

'sub1' => (!empty($_GET['sub1']) ? $_GET['sub1'] : ''),
1

To:

'sub1' => (!empty($_POST['sub1']) ? $_POST['sub1'] : ''),
1

Save your changes.

# TerraLeads

When you click the Generate API button, access to the Webmaster API file will open, allowing the transmission of information to the affiliate network via API. In the next menu, the Postback URL is configured.

Take the Postback URL from the TerraLeads affiliate network template in Keitaro.

Next, edit the landing page files.

Open the file and add a line with the subid parameter to each form on the site:

<input type="hidden" name="sub_id" value="{subid}">
1

Save the changes and edit the next file.

Open the file and find the line $data = array(.

Add sub_id to the parameters:

'sub_id'  => $_POST['sub_id'],
1

The result looks as follows:

Save the landing files and upload the archive to Keitaro. The setup is complete.