Tracking with yct.js¶
If you want the
userid to be generated automatically, just leave out the user params in the
If a predefined cookie already exists then it will be used, otherwise a new one will be created.
Tracking Code Quickstart¶
In order to use this on your pages, copy the code snippet below, replacing
<YOUR_MANDATOR_ID> with your mandator ID,
<PAGE_ID> with your page/item identifier and
<USER_ID> with the one generated by your user identifier. All identifiers can be any form of string. Paste this snippet into your website template page so that it appears before the closing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
How the Asynchronous Syntax Works¶
_ycq object is what makes the asynchronous syntax possible. It acts as a queue, which is a first-in, first-out (FIFO) data structure that collects API calls until
yct.js is ready to execute them. To add to the queue, use the
Tracking Code: The _ycq Global Object¶
_ycq global object can be used directly for asynchronous page tracking via the
_ycq Object Methods¶
Here is an example of typical usage of the method:
1 2 3
Tracker Object Names¶
||- Executed with one additional parameter:
||- Executed with 4 additional parameters:
|capturing an event:
||- Executed with 5 additional parameters:
|consume event sent after 20s:
||- Executed with 2 additional parameters: anonymous userId, pseudonymous userId.
- It is to be triggered when a user logs in and the tracking identity is changed.
||- If you want to send a click recommended event you can append the following parameter to the recommended item URLs:||https://mydomain.com/mypage.html?ycreco=true or
Tracking with HTML Event Handlers¶
The asynchronous tracking syntax should also be used from within DOM event handlers. For example, the following button generates an event when it is clicked:
yct.js, the event will be captured and eventually executed.