# Landing page: Local

Keitaro stores locally the landing pages with type Local.

# Requirements

HTML:

  1. The main page must be named index.html.
  2. If landing page contains <base/> tag, you must delete it. Keitaro create is itself to correctly load images, and style sheets.
  3. Avoid auto-refreshes, js-redirects and anti-bounce scripts.

PHP:

  1. The main page must be named index.php.
  2. Forbidden functions exec(), system(), job_start(), eval().
  3. If the code loads scripts with include() or require(), it must specify the full path (using dirname(__FILE__) or an alternative).

Example:

  • require_once dirname(__FILE__) . '/src/lib.php'; is correct.
  • require_once 'src/lib.php'; is incorrect.
  1. Maximum page load is 3 seconds. If the code makes http-requests, it must set the request timeouts. Example:

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); 
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
1
2

# Making ZIP file

Prepare on you computer a folder with the files of the landing page.

  • (Windows) Press the right mouse button and choose Compress to ZIP file.
  • (macOS) Press the right mouse click and choose Compress.

# Uploading ZIP file

Press Choose file or drop the file on the field:

Fill in the other settings if needed, then press Create.

  1. Open the landing page in the Editor.

  2. Set up JS Adapter on every page of the landing page.

  3. In the campaign flow select the Landings and Offers schema. Аdd the created landing and offer to the one flow.

  4. Create offer link using /?_lp=1 as href.

Example:

<a href="/?_lp=1">Offer</a>
1

Example of making links to multiple offers on one page:

<a href="/?_lp=1&offer_id=10">Offer ID 10</a>
<a href="/?_lp=1&offer_id=22">Offer ID 22</a>
1
2
Alternative solution

That link opens a random offer from the flow:

<a href="{offer}">Offer</a>
1

To send to a specific offer, add &offer_id=ID. Example:

<a href="{offer}&offer_id=100">Offer 1</a>
<a href="{offer}&offer_id=200">Offer 2</a>
1
2

# Sending postback

  1. Open the landing page in the editor.

  2. Set up JS Adapter on each page of the landing page.

  3. Set up Postback.

Alternative solution
  1. Open the landing page in the editor.

  2. Find the form.

  3. Add to the form <input type="hidden" name="_subid" value="{subid}" />.

Example:

<form action="submit.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">Submit</button>  
</form>
1
2
3
4
5
6
7
8
  1. Open the PHP file that processing form data.

  2. Use $_POST['_subid'] to get subid.

Example 1:

file_get_contents('POSTBACK_URL?status=lead&subid=' . urlencode($_POST['_subid']));
1

Example 2:

$data = array(
  'sub1' => $_POST['_subid'], // <---- that parameter is added
  'name' => $_POST['name],
  ...
);
1
2
3
4
5

# Updating parameters

Read page Updating Parameters

# Protecting from direct visits

  1. Open the editor
  2. Open index.php (rename index.html to index.php if needed).
  3. Add that code to the top:
<?php
if (!isset($rawClick) && !isset($click)) {
  die();
}
?>
1
2
3
4
5
How to protect on the flow level?
  1. Add filter Parameter.
  2. Type name external_id, value @empty and mode NO.

That prevents from opening the flow without external_id parameter.

# FAQ

Why are images not working?

Paths to images must be relative (without / in the beginning). Example:

  • <img src="/home.png" /> is incorrect.
  • <img src="/img/home.png" /> is incorrect.
  • <img src="home.png" /> is correct.
  • <img src="img/home.png" /> is correct.
Why is the local landing showing Timed out?

This message is shown when landing page content exceeded the maximum execution time. By the content is meant a links to remote resources, scripts etc. To fix this issue you must check browser console errors, and report the issue to the author of landing page code. The current maximum execution time is set in "Execution timeout for local landing pages, and local offers' param. It can be found in Maintenance → Settings → Main menu. Maximum value is limited to 9 seconds.

worker error EOF

Possible reasons:

  1. The landing page contains PHP redirects.
  2. The landing page code contains "FATAL" errors. See System Log page.
Why does page redirect immediately to `/lander/name/index.html`?

It means that the landing page contains some script inside that make this redirect. You must find and remove it.

Why don't popups work?

That means the popup uses href attribute. For example, <a class="slow-scroll" href="#form2">order</a>. You may host that landing page somewhere and use redirect instead of Local.

Why doesn't JS script work?

Open Browser's Developer Console and check if there's an error.

How to pass parameters from traffic source through landing page?

See Passing Traffic Source Parameters page.

How to use Facebook Pixel?

See FB Pixel page.

How to use TikTok Pixel?

See TikTok Pixel page.

::: Why doesn't the smooth scrolling work?

Look for a JS code, function or a separate method in the landing page that uses $('html, body').animate({…}).

The .animate() Method. is a built-in method for the jQuery library that performs the animation.

This method is used in selector.Click() or selector.on('touch, click): selector.click(function() { $('html, body').animate(positionSelector , timeAnimate); }).

Find the specified selector. It's probably a link with a class. The class is specified as a selector. For example: <a class="to_form" href="#">link</a>.

Change all links if the scroll animation doesn't work.

Wrap the link in <span> tag, and specify the class of the link to the tag. Remove all attributes from the link (class and href).

As a result: <span class="to_form"><a>link</a></span>

How to show date and time?
echo (new DateTime(null, new DateTimeZone("Europe/Moscow")))->format("Y-m-d H:i");
1