Identification of unique visitor



Before starting implementation of the ClientSideUserId plugin, please make sure you have initialised the AT Internet JavaScript Tracker and selected the plugin from within the Tag Composer interface.



By default, recognition of unique visitors is done via a third-party cookie placed by AT Internet’s collection server.
The ClientSideUserId plugin enables a visitor to be tracked by creating a user ID in cases where writing a third-party cookie is not feasible. For example, this might be the case on an Intranet site, or when the Safari browser is used (default settings), or when a visitor browses using an Apple device like iPhone, iPad or iPod. It is also possible to configure the plugin to force the use of a random or custom ID. This ID can be found in the idclient variable, present in all hits when the plugin is active.


Plugin setup

The plugin’s mode of function can be directly configured from within the interface, or via the settings when the Tracker is initialised.

Three modes are available:

  • required (by default): The user ID is added to all hits on the Safari browser, or in cases where an Apple device is used.
  • always: The user ID is added to all hits, on any type of device.
  • never: The plugin is disabled, the user ID is never added to hits.

To change the mode, please add the following code where desired:

Add user ID to all hits, only for affected devices (Safari, iPhone, iPad, iPod):

Add user ID to all hits:

Never add user ID:


Managing user ID

The user ID must be filled in during the user’s entire visit (on all hits). This ID is stored in a cookie on the domain indicated in the Tracker settings (cookieDomain variable), in order to be re-used on pages where it is not filled in.

If needed, the cookie containing the user ID can be configured directly via the settings:

Define cookie lifetime (in days, 397 by default):

Define a set/fixed lifetime for the cookie (by default):

Set up a sliding/relative cookie:


Declaring user ID

If an ID is not found in the tag, nor in the cookie, a unique ID is generated.

You may force a user ID:

By passing a userIdentifier context variable:

By using the plugin’s set function:

In cases where both methods are used, the set function retains priority.

Was this post helpful?
Last update: 16/07/2018