Advanced javascript/ pixel usage

This is a list of exposed javascript functions from the LeadBoxer tracking pixel. 

ot_uid()
Returns an internal id that represents the user (i.e. the browser)
ot_sid()
Returns an internal id that represents the session

onload=map
If you want the pixel to collect default data (for instance a value from the URL) you may need to wait before you want to send the data to the logging servers. 

The following script shows how to turn off the default send on load, collect data from a map and then send it. This will enable you to add extra data and trigger the sending of the data at a later stage. 

The following example illustrates this.

<!-- LEAD PIXEL START -->
<script type="text/javascript" src="//script.leadboxer.com/?dataset=yourDatasetId&onload=map"></script>
<!-- LEAD PIXEL END -->

<script> 
_otmap.put("partner","PartnerName");   // setup a map with a name and a value
OTLogService.sendEvent(_otmap);	       // send the map
</script>

The OTLogService.sendEvent() method is called to send events. 

Static version of the javascript library

The Leadboxer tracking script or pixel is served form a high availability, low latency, geo-ip based custom build Content Delivery Network. 

It also is not a static javascript, meaning the code can change based on various use-cases/ scenario's.

However, in case you really want or need to load the javascript library from your own servers or location, you can accomplish this with these 2 steps:

  1. Copy the contents of the hosted javascript to a local javascript file
  2. Replace the variable ot_t0 with a function that generates the current time in unixtime.
    For example with the  Date.now() function 
  3. Load this static javascript on your pages.
  4. Test

Make sure you regularly rerun these steps, as we make changes to our hosted version the tracking javascript often.

Important notice / disclaimer

Some portions of the LeadBoxer javascript library are dynamically generated and provide customised code for advanced features like cross-device or cross-browser tracking, auto-form tracking and other functions. Meaning that the basic tracking features will work properly, but we do not guarantee that all advanced features work as designed when using a static version of our pixel. 

Still need help? Contact Us Contact Us