OT4: What does the javascript library look like?

Documented exposed javascript functions (2019.09.02). Please see this help page for an example of using some of these functions.

Get the value of a key; ot_map is the map of key/ value pairs being sent to Opentracker's engine for processing on the server.

ot_tag(key, value);
Creates a cookie with the key value/ pair, called a tag. Survives browser refresh/ restart. Survives across domains and devices depending on the Opentracker account subscribed to.
ot_log(map, callback_function)
Send the key/ value pairs stored in map to the logging server. When done call the callback_function, if given.
ot_onload(sessionId, userId)
Called when script has loaded. sessionId and userId are passed to this callback function.
Returns an internal id that represents the user (i.e. the browser)
Returns an internal id that represents the session

Get the value of the parameter key in a url. (i.e. for https://www.opentracker.net/?key1=value1 ot_gp("key1") will return value1.

Return a map representing key value pairs in a url. (i.e. utmMarker = ot_grxp("/utm_.*/") returns a map of all parameters prefixed with utm_ 

Hash a string for privacy. Constructs an encoded crc32 long number - ala https://stackoverflow.com/questions/18638900/javascript-crc32 and formats as hex - see https://stackoverflow.com/questions/9909038/formatting-hexadecimal-number-in-javascript

Need more information on how to implement things in your business? Schedule a Call