User ID Syncing with Sync.js - Detailed Reference Guide


This page provides reference details for all available Lotame Sync.js Tag functionality. If you need further assistance, please get in touch with Lotame by submitting a Support ticket form through this link.

Sync.js Tag Setup

The Lotame Sync Tag javascript setup on your website involves an input object that gets passed to an initialization function that prepares a window namespace on your page for the javascript tag itself. The basic setup looks like the following:

  <link rel="preconnect" href="">
  <link rel="preconnect" href="">
  <link rel="preconnect" href="">
  <link rel="dns-prefetch" href="">
  <link rel="dns-prefetch" href="">
  <link rel="dns-prefetch" href="">

  ! function() {
    // Callback that will be triggered after each call to sync()
    // and let you have access to the profile and/or panorama ids
    var syncCallback = function (profile) {

        // Get the profile id
        var profileId = profile.getProfileId();

        // Get the panorama id
        var panoramaId = profile.getPanorama().getId();

    var lotameClientId = '<lotameClientId>';
    var lotameTagInput = {
        config: {
            onProfileReady: syncCallback

    // Lotame initialization
    var lotameConfig = lotameTagInput.config || {};
    var namespace = window['lotame_sync_' + lotameClientId] = {};
    namespace.config = lotameConfig; = {};
    namespace.cmd = namespace.cmd || [];
  } ();

<!-- Pull the sync.js script itself in -->
<script async src="<lotameClientId>/sync.min.js"></script>

The details of the input data and config options are below.

Config Object Details

The config object in the Lotame Sync Tag input has the following possible parameters:

Parameter Description Type Required? Default
onProfileReady This callback function is called every time a sync() call completes. function (profile) No {}
gpc Tell Lotame if the Global Privacy Control should be enforced. Only set to 1 if the user has an active GPC flag so Lotame can disable processing on the page. boolean No 0

Callback Profile Object Details

The onProfileReady callback fires after the sync call return and provides a profile object with the following methods.

Method Name Return Type Parameters Description
getProfileId() String n/a The id of the profile associated with the browser
getPanorama() String or NULL n/a An object with two methods:
1. getId() - returns the String Panorama ID™ linked to the Profile ID
2. getIdType() - returns a String that is either 'panoIndiv' or 'panoDevice'. See the below getPanorama() method details for further information.

Data Object Details

The data object provides a way to pass in a Third Party ID to Lotame. However, it is not required and can either be left empty or not provided. 

Name Description Example
thirdParty An identifier to associate with the current browser, typically to enable server-side data transfer. Your Lotame representative will provide the namespace value as necessary for your implementation.
  thirdParty: {
    namespace: 'FAKE',
    value: '123456789101112131415'

Sync.js Tag Methods

The following methods are also available on the window.lotame_sync_<lotameClientId> namespace is available any time after the main script block is defined. Whenever you make calls against the namespace, you should wrap them in a call to window.namespace.cmd.push(), as that allows your code to execute asynchronously as soon as our tag finishes loading on your page.

Using the below methods directly is a secondary option to retrieve the values inside the callback function. Use whichever scenario works best for your codebase.


The Sync call is what fires to pass your identifiers to Lotame and fires the onProfileReady callback.

<!-- Initiate the sync call. When it completes, it will trigger syncCallback with a profile object -->
    window.lotame_sync_<lotameClientId>.cmd.push(function() {


getPanorama() returns an object with two methods; getId() and getIdType(). The getId() returns the Lotame Panorama ID as a string. The getIdType() returns the type of Panorama ID as a string and will be either 'panoIndiv' or 'panoDevice'.

window.lotame_sync_<lotameClientId>.cmd.push(function() {
  var PanoObject = window.lotame_<lotameClientId>.getPanorama();
  var PanoID = PanoObject.getId();
  var PanoIDType = PanoObject.getIdType();

The ID Type value panoIndiv denotes an Individual-Based Panorama ID that connects multiple devices (desktop, mobile, CTV, etc) to a single individual persona panoDevice is to note Device-Based Panorama ID that connects IDs to a single device/browser. If Lotame cannot resolve a browser to a panoIndiv, it will attempt to assign it to a panoDevice ID.

Note - Depending on what other Lotame tech is on the page, there is a chance Lotame will return an UNKNOWN ID type. This can happen because Lotame has not fully implemented the getIdType across all of its server-side endpoints.


The getProfileId() method looks in local storage and cookies for a previously retrieved Lotame profile id and returns it to the caller.

window.lotame_sync_<lotameClientId>.cmd.push(function() {
  var lotameProfileId = window.lotame_sync_<lotameClientId>.getProfileId();


The setIdentity() method is used to pass user-identifiable info directly to Lotame for use in targeting. As of this writing, email is the only supported identifier type.

This functionality is part of our Lotame Spherical offering. If you would like to explore using it, please reach out to your Lotame account representative for more information and details.

window.lotame_sync_<lotameClientId>.cmd.push(function() {
    { id: '', type: 'EMAIL'}

Also, in the <head> of your page, include the below to speed up HTTP & DNS overhead time of the setIdentity() call.

<link rel="preconnect" href="">
<link rel="dns-prefetch" href="">
<link rel="preconnect" href="">
<link rel="dns-prefetch" href="">

Note: the email being passed should be whitespace trimmed and set to lowercase before submission to follow industry best practices.