Local Landing Pages in Keitaro: Order Form and Postbacks

Keitaro 9 has a unique feature of uploading Local landing pages in its admin panel.

This feature allows uploading zip archives to a root directory of Keitaro. Later these landers can be used in campaigns and can be opened without a redirect.

Below is a step-by-step guide of uploading a Local Landing page and setting up a postback sending to Keitaro after submitting an order form.

Prepare a landing page

We have a folder with the landing page. index.html or index.php should be executed files in the folder.

E.g. we have the following situation:

Rename the file and make sure it’s index.html or index.php. Convert the folder with a landing page into a zip archive.

This archive can be uploaded to Keitaro now:

Go to Landing pages, click on Create. Choose Local Landing type, and upload the archive to a tracker, click on Upload and Save:

After the upload a landing page will be available in a list of landing pages. Also, you’ll be able to preview this added landing page. You can check if a landing page opens the right way.

Sending a postback after submitting an order form

To set up a postback after submitting an order form a visitor should be sent to a successful purchase page, and then a conversion will be sent to a tracker.

Thus we need the following changes:

  1. Add a success page.
  2. Add call.php page
  3. Add subid sending from a landing page to a tracker.

All these changes can be done on Keitaro VPS in a lander folder, but we’ll will delete added landing page and make a new archive for uploading.

Prepare a lead-form

subid is necessary for transferring information about a visitor from a landing page to a call.php page and submitting a conversion.

Open index.html page and find “action” tag, there’s a code in it which sends the information to call.php.

Check if an action in a form calls for call.php, and there’s a post method inside:

<form action="call.php" method="post" >

Also, insert a code for subid sending before a closing tag:

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

Finally, the whole order form should look as follows:

<form action="call.php" method="post">
 
    <input type="hidden" name="subid" value="{subid}" />
 
    <input type="text" class="form__input" name="name"  placeholder="Your Name">
 
    <input type="tel" class="form__input" name="phone"  placeholder="Phone Number">
 
    <button class="btn form__btn" type="submit">Order</button>  
 
</form>

Save the changes and close the file.

Creating a call.php script

Call.php script usually sends leads to an affiliate network. We will use this script for sending postbacks to a tracker.

Go to Maintenance > Settings and enable “Allow PHP in ulpoaded landing pages”.

Create a new call.php file with the following code:

<?php
 
$url = 'your postback url?status=lead&subid=' . urlencode($_POST['subid']);
 
file_get_contents($url);
 
header('Location:success.html');
 
?>

Postback URL can be found in Maintenance –  Postback URL.

If you need payout amount you can add payout and currency parameters, e.g.:

<?php
 
$url = 'http://retpks.com/a73335f/postback?payout=100&currency=rub&status=lead&subid=' . urlencode($_POST['subid']);
 
file_get_contents($url);
 
header('Location:success.html');
 
?>

Here we mentioned success.html page which we are going to create next.

Creating a success.html page

This page opens after an order submission. Usually, this page is used to thank visitors or for upsells.

Create a success.html file.

Compress the folder with our landing page and upload the archive to Keitaro.

Creating a campaign

Go to Campaigns page, click on Create. Then create a stream, Choose Landings and Offers in Schema tab, add an uploaded landing page. Save the changes to the campaign:

Copy the campaign’s link and complete the order form. After submitting the order you will see an opened success.html page.

The conversion will appear in a tracker in 30-60 seconds. Open the tracker and check the conversion:

Keitaro received the conversion, we sending the postback the right way.

Useful Info

Keitaro Knowledge Database
Landing Pages
Keitaro YouTube Channel

author avatar
Keitaro Team
Team to deliver fresh and quality content!