Binom Documentation

К навигации

Updating tokens from lander

For those who like to learn their traffic in details, our tracker provides the ability to update the information about the click from lander. To use this feature, add inside <head></head> the following code:
<script type="text/javascript">
tracker_url='http://YOUR_TRACKER_URL/';
function lp_update_token(token,value)
{
var o = document.createElement("img");
o.src=tracker_url+'click.php?lp=data_upd&'+token+'='+value;
}
</script>

Tracker does not update existing source tokens, so use any other names. For example, you want to display information about the object (undefined for all mobile devices). In this case, you can use the token name “orientation”. In the campaign report in the list of tokens is added an item LP T: orientation.

For data transfer to this token, use the lp_update_token function as follows: lp_update_token('orientation','yes');
You can use multiple tokens for a single click (no more than 10 tokens), just use this function several times. For example, you need information not only about orientation, but also you want to send the user-agent.
lp_update_token('test',navigator.userAgent);

Note: if you want to update tokens on landing with LP Pixel, then you need to make a small delay in the script executing. For example:
<script>
setTimeout( function(){
lp_update_token('orientation','yes');
}, 300);
</script>

Example with orientation

<head>
...
<script type="text/javascript">
tracker_url='http://YOUR_TRACKER_URL/';
function lp_update_token(token,value)
{
var o = document.createElement("img");
o.src=tracker_url+'click.php?lp=data_upd&'+token+'='+value;
}
</script>
</head>
<body>
...
<script type="text/javascript">
if (typeof(window.orientation)!="undefined")
{ lp_update_token("bot","no"); }
else
{ lp_update_token("bot","yes"); }
</script>
...
</body>

Example of parameters transfer from the $ _SERVER variable

For example, you need to take off the HTTP_ACCEPT_LANGUAGE head.
<head>
...
<script type="text/javascript">
tracker_url='http://YOUR_TRACKER_URL/';
function lp_update_token(token,value)
{
var o = document.createElement("img");
o.src=tracker_url+'click.php?lp=data_upd&'+token+'='+value;
}
</script>
</head>
<body>
...
<script type="text/javascript">
lp_update_token('header_lang','<?php echo $_SERVER['HTTP_ACCEPT_LANGUAGE']; ?>');
</script>
...
</body>

Don’t forget that landing page in this example must have the .php.