# Set up a cookie sync

## Before starting

Each vendor solution identifies browsers via a proprietary COOKIE\_ID. This prevents them from sharing user data with other solutions directly. The cookie synchronization allows vendors to share their Unique Identifiers with the Commanders Act CDP.

Commanders Act sends a request to the vendor server to get their COOKIE\_ID for a user and then stores the mapping on the Commanders Act servers. Cookie synchronization maps different IDs together and thus enables user data to be shared.

![Cookie synchonization process](https://2369238037-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlBEwG5kQoxsckaoAZh%2F-LlBFNgnkgDocqwAs1ji%2F-LlBKav_cHhcI5gK02jd%2Fcookie-sync.JPG?alt=media\&token=d4643cd6-f0c4-40a8-876d-825874dab601)

## Requirements

* **Web service URL**: The vendor solution provides Commanders Act with the URL to be called to trigger the webservice and get its COOKIE\_ID for the current browser
* **Commanders Act Token**: Commanders Act provides the vendor with a 32-character unique ID (ex: KD04a85DjH1015yzuAu7pnaoTh5P53iL). This token will be used to send request to the Commanders Act web service.

## Process

1\) Commanders Act sends a request to the vendor's web service through its JavaScript tag (browser side).

{% code title="302 redirect URL example" %}

```
https://tagcommander.sync.partner.com/commanders-act
```

{% endcode %}

&#x20;2\) The vendor API sends its COOKIE\_ID to <http://sync.commander1.com/**#PARTNER\\_TOKEN#**/**#UID#>\*\* by replacing on the fly the **#UID#** in the destination URL.  The **#TOKEN#** is provided by Commanders Act and unique per vendor.

{% code title="Commanders Act call example" %}

```
http://sync.commander1.com/KD04a85DjH1015yzuAu7pnaoTh5P53iL/831483791534
```

{% endcode %}

![Expected network result (example with adotmob partner)](https://2369238037-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlBEwG5kQoxsckaoAZh%2F-LlBRsjeDYG3CFuLRcRO%2F-LlBSypmdCgTOwMwXKLy%2Fcookie-sync-%C3%A9.JPG?alt=media\&token=c4119db3-e62c-4610-a0b8-465cc359ab51)

3\) Commanders Act stores the vendor COOKIE\_ID into its cookie sync mapping table. This database keep an history of Commanders Act unique ID & every synchronized vendor COOKIE\_ID(s).

4\) End users can create segments from DataCommander UI. The COOKIE\_IDs will be translated into the vendor's one when extracting the data, so the vendor will be able to re-use them.
