ID Synchronization by URL or Data Source

The ID service functions idSyncByURL and idSyncByDataSource let you manually implement an ID sync in the Destination Publishing iFrame. These are available in VisitorAPI.js versions 1.10, or higher.

Syntax, Properties, and Macros


Code Synchronizes User IDs


Between different data partners and Audience Manager by using a custom ID sync URL.


When you already know the DPID and DPUUID and want to send it to Audience Manager in the standard ID sync URL format.


The following table lists and defines the properties available to both functions.

Name Type Description
dpid String

Data provider ID assigned by Audience Manager.

dpuuid String

The data provider's unique ID for the user.

minutesToLive Number

(Optional) Sets the cookie expiration time. Must be an integer. Default is 20160 minutes (14 days).

url String

Destination URL.


Both functions accept the following macros:

  • %TIMESTAMP%: Generates a timestamp (in milliseconds). Used for cache busting.
  • %DID%: Inserts the Audience Manager ID for the user.
  • %HTTP_PROTO%: Sets the communication protocol (http or https).

Sample Code and Output

Both functions return Successfully queued if successful. They return an error message string if not.


Sample Code

   //Instatiate Visitor
    var visitor = Visitor.getInstance
   // Fires url with macros replaced
    dpid: '24', // must be a string
    url: '//{{uid}}',
    minutesToLive: 20160 // optional, defaults to 20160 minutes (14 days) });

Sample Output


Sample Code

  //Instantiate Visitor
   var visitor = Visitor.getInstance
  // Fires 'http:/https:' + '//'
     dpid: '24', // must be a string
     dp     minutesToLive: 20160 // optional, defaults to 20160 minutes (14 days) });

Sample Output

On this page