Working with Landing Pages

How to create a Landing Page

Keitaro works only with external lending pages. Both an ordinary HTML page hosted on a server, as well as a page, created on a special service landing builder can be a “landing page”.

Adding Landings

Keitaro provides the following ways of working with landings:

  1. Landing preloads to Keitaro and is shown right after you open a campaign.
  2. Tracking script is switched on for the landing. This solution is possible, when there is already a traffic on this landing and you need to track its metrics. Optionally, you can switch on an ofer split the same way.

How to Add a Landing Page to Keitaro

An example of adding a landing and creating a landing split and an offer split:

  1. Prepare a landing page.
  2. Add landings on the “Landing Pages” tab.
  3. On the “Landings” tab click “Instruction”. Choose the most suitable link to offer for you. Install this link to your pages.
  4. Add offers on the “Offers” tab.
  5. Create a campaign.
  6. Create a stream with Landings scheme. Choose necessary landings and offers.
  7. To get an URL for traffic sending, click on “Integrate” or “Get URL” buttons.
  8. Open the URL in a browser and check if everything works well.

If landing page contains a form you must add a hidden input to all the forms:

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

Later you can use it to send postbacks.

Using Tracking Script for Stand-alone Landing Page

Use this method you you receive traffic straight on the landing page.

  1. Create a campaign.
  2. Add the landing on the “Lendings” tab of Keitaro.
  3. Click the “Instruction” button, go to “Tracking script” tab. The Landing ID is written in the code, that's why it's necessary to have a new code for every landing.
  4. Add the code to your landing.
  5. Put the landing URL in the ad.

(Optionally) Adding offers and split offers.

  1. Add offers on the “Offers” tab.
  2. Create a stream in the campaign, use “Offers” scheme. Choose necessary offers.
  3. Add a new URL to the landing:
<a href="{offer}">LINK</a>

It's obligatory to check how the landing works. The link should take you to one of your offers.

You can read more about a tracking script and its possibilities on this page Tracking script.

Using Click API Client to a landing page (PHP)

This option, as well as the tracking script, allows getting traffic directly. This option's distinguishing feature is that it works on the server side and the user receives only the final result.

Let's look closer at the solution with split offers on a landing, without any redirects.

  1. Create a campaign.
  2. Create a stream with “Offers” scheme. Add necessary offers.
  3. Go to “Integrate” page. (Additional > Integrate).
  4. Choose “Click API Client v2”.
  5. Copy and paste the code to your landing page template.
  6. Check how the landing works.

If you want to show offer link instead of perform actions, do the following:

  1. Delete the line in the code $client->execute() (it causes instant redirect to an affer).
  2. In a template, write this link to the offer <a href="<?php echo $client->getOffer()?>">Offer Link</a>.

How to send a lead from a landing page without tracking script

Briefly, you need to do the following:

  1. Send subid to a landing.
  2. Receive subid on a landing, saving it in a session.
  3. Send a postback, when the order is completed.

Now more detailed:

1. Add subid sending in a stream, e.g. http://landing.ru/?subid={subid}.

2. Add subid saving in a session on a landing (on all pages, in case there are several of them):

<?php 
start_session();
if (!empty($_GET['subid'])) {
  $_SESSION['subid'] = $_GET['subid'];
}
?> 

3. Add affiliate networks on “Affiliate networks” tab. Create any name, e.g. “Contact Collection”. Use basic postback.

4. After an order is completed, send a postback:

<?php
file_get_contents('http://domain.ru/123/postback?subid=' . $_SESSION['subid']. '&payour=1.23&status=sale');
?>

http://domain.ru/123/postback change into your basic postback. You can read more about postbacks on the page Postbacks (incoming).

How to transfer all parameters via the landing page

If you use a “Landings > Offers” scheme, all parameters are put in offer's URL. Below is the solution, if you use a static link on a landing.

The solution on PHP:

<a href="http://offer.com/?id=123&<?= http_build_query($_GET) ?>">Link</a>

The solution on JS:

<script>document.write('<a href="http://offer.com/?affid=123&' + window.location.search.replace('?', '') + '">Link</a>'</script>

How to redirect traffic from the landing into an offer, which is in a stream

Go to “Landings” page, click on an “Instruction” button. Choose the most suitable code variant and set up your landing with it.

How to put more than one offer on a landing page

Take a code of a link generation for offers, as it is described in a previous section. Use this code to generate links for every offer on a landing page and add offer_id=ID, where ID is an offer ID. Thus, you can mark the offer where traffic should be redirected to.

An example of a landing page with a preload:

<a href="{offer}&offer_id=123">Buy X</a>

An example for a php link:

<a href=\"#{@lpUrl}&_token=<?php echo urlencode($_GET['_token'])?>&offer_id=123\">Buy X</a>

How to transfer a parameter, if there is an order form on the landing page

Add parameters sending to the code of the form. E.g. sub1 parameter is transfered the following way:

<input type="hidden" name="sub1" value="<?php echo urlencode($_GET['sub1']);?>">

Why are the metrics, LP clicks, LP CTR and Sale time not calculated

To calculate these metrics you need to set up a visit to the offer through Keitaro. As you need to add offers to Keitaro and set up both landing pages and offers in one stream, there should be installed a code of sending to the offer.

How to use the information about the user on a landing page (in case you're using redirect)

The solution works only in case the traffic is in Keitaro in the beginning.

Edit landing settings. Add necessary parameters and Macros:

http://landing.com/page?model={device_model}&city={city:ru}

You can insert necessary parameters on the landing:

<html>
  <head>
     <script type="text/javascript">
       function getURLParameter(name) {
           return decodeURI(
               (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
           );
       }
       </script>
  </head>
<body>
  Phone cases <script>document.write(getURLParameter('model'))</script> 
  in the city <script>document.write(getURLParameter('city'))</script>
</body>
</html>

If PHP is allowed, you can call like the following

  Phone cases<?php echo htmlentities($_GET['model'])?>
 in the city <?php echo htmlentities($_GET['city'])?>

How to use the information about the user on a landing page (in case you're using preload method)

You can use all available Macros in the landing HTML code. An example of using a {subid} macros:

<script type="text/javascript"> 
var m1_product_id = 123; 
var ref = 123; 
var script = document.createElement("script"); 
script.src = "http://m1-shop.ru/send_order/?ref="+ref+"&s={subid}&w="+getC("w")+"&t="+getC("t")+"&p="+getC("p")+"&m="+getC("m")+"&product_id="+m1_product_id+'&out=1'; 
document.body.appendChild(script); 
</script>

In case “Landing > Offer” scheme is used in streams, the link to the offer is created with macros {offer}:

<a href="{offer}">CLICK</a>

How to update click's parameters from a landing page

Read this page Updating Params.

How to transfer parameters to FB pixel

The example of transfering subid when the “Preload” landing page option is switched on:

<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
// Insert Your Facebook Pixel ID below. 
fbq('init', 'FB_PIXEL_ID');
fbq('track', 'view', {
   subid: '{subid}'   
})
</script>

How to protect a landing page from direct visits

1. Transfer a parameter in a landing URL,e. g. code=123 (http://landing.com/?code=123)

2. Add a code in the very beggining of the landing page:

if (!isset($_GET['code']) && $_GET['code'] != '123') { die(); }

How to add a LP on BlueHost.com?

  1. Create a subdomain
  2. Create a website on that subdomain. For example, you can install a WordPress there.
  3. Check it.
  4. Create a Landing Page in Keitaro. Enter enter the subdomain URL and enable “Preload”