Comment on page

JavaScript API Command Overview

To track visitors' activity on your website using the JavaScript API, you have to push commands to a command queue inside a global object called kd (available on all the website pages where you added the tracking code). A command is represented by an array:

Example of a command

["command1", param1, param2]
The first element of the array corresponds to the command name (or command action), and the following optional elements correspond to parameters that specify the data needed by the command. When a command is added to the queue, it is not executed immediately (data is not immediately sent to the server). The execution is triggered by pushing the submit command. Once the submit command is added, the commands stored in the queue are sent to LYNX. Commands are added to the queue using the push method.


kd.push(["view", "429500"]); //Add a "view" command.
kd.push(["submit"]); //Add the "submit" command (with no parameters) to execute the "view" command.