# Landing page: Local
Keitaro stores locally the landing pages with type Local.
# Requirements
HTML:
- The main page must be named
index.html
. - If landing page contains
<base/>
tag, you must delete it. Keitaro create is itself to correctly load images, and style sheets. - Avoid auto-refreshes, js-redirects and anti-bounce scripts.
PHP:
- The main page must be named
index.php
. - Forbidden functions
exec(), system(), job_start(), eval()
. - If the code loads scripts with
include()
orrequire()
, it must specify the full path (usingdirname(__FILE__)
or an alternative).
Example:
require_once dirname(__FILE__) . '/src/lib.php';
is correct.require_once 'src/lib.php';
is incorrect.
- 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);
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.
# Creating offer link
Open the landing page in the Editor.
Set up JS Adapter on every page of the landing page.
Create offer link using
/?_lp=1
ashref
.
Example:
<a href="/?_lp=1">Offer</a>
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>
2
Alternative solution
That link opens a random offer from the flow:
<a href="{offer}">Offer</a>
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>
2
# Sending postback
Open the landing page in the editor.
Set up JS Adapter on each page of the landing page.
Set up Postback.
Alternative solution
Open the landing page in the editor.
Find the form.
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>
2
3
4
5
6
7
8
Open the PHP file that processing form data.
Use
$_POST['_subid']
to get subid.
Example 1:
file_get_contents('POSTBACK_URL?status=lead&subid=' . urlencode($_POST['_subid']));
Example 2:
$data = array(
'sub1' => $_POST['_subid'], // <---- that parameter is added
'name' => $_POST['name],
...
);
2
3
4
5
# Updating parameters
Read page Updating Parameters
# Protecting from direct visits
- Open the editor
- Open
index.php
(renameindex.html
toindex.php
if needed). - Add that code to the top:
<?php
if (!isset($rawClick) && !isset($click)) {
die();
}
?>
2
3
4
5
How to protect on the flow level?
- Add filter
Parameter
. - Type name
external_id
, value@empty
and modeNO
.
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:
- The landing page contains PHP redirects.
- 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");