---
title: MGID Cookie Matching Guide for DSPs
description:   For matched users, both SSP UID and DSP UID will be sent in the fields bidRequest.user.id and bidRequest.user.buyeruid (find more here). If user is new, there only SSP UID (bidRequest.user.id) will
---

[Skip to content](https://help.mgid.com/cookie-matching#main-content)

English

Show submenu for translations

![MGID\_Logo\_Help\_Center\_W\_R\_Swoosh.svg\]](https://help.mgid.com/hubfs/MGID_Logo_Help_Center_W_R_Swoosh.svg)

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)

Open main navigation

Close main navigation

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)
- English
  
  Show submenu for translations
- Contact us

 Contact us

 Welcome to MGID! How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center Home](https://help.mgid.com/?hsLang=en)
2. [DSP](https://help.mgid.com/dsp?hsLang=en)

# MGID Cookie Matching Guide for DSPs

[How Cookie Matching Works](https://help.mgid.com/cookie-matching#toc1)

[Cookie Matching Scenarios](https://help.mgid.com/cookie-matching#toc2)

[Macros and Parameters](https://help.mgid.com/cookie-matching#toc3)

[Result in Bid Requests](https://help.mgid.com/cookie-matching#toc4)

[Choosing the Integration Scenario](https://help.mgid.com/cookie-matching#toc5)

Cookie matching allows MGID (SSP) and a Partner (DSP) to associate their user identifiers. This enables MGID to pass both the MGID user ID and the Partner's user ID in a Bid Request when the user has been successfully matched.

### How Cookie Matching Works

MGID and the Partner use their own user identifiers. Cookie matching creates a mapping between these identifiers.

For a successfully matched user, MGID sends both identifiers in the OpenRTB Bid Request:

- user.id - the MGID user ID (SSP ID)
- user.buyeruid - the Partner's user ID (DSP ID)

For a user who has not been matched yet, only the MGID user ID is available in the Bid Request.

The matching process is based on redirects between MGID and the Partner. Depending on which platform initiates the sync and where the mapping is stored, there are different integration scenarios.

### Cookie Matching Scenarios

**1. MGID initiates the sync, and MGID (both) stores the mapping**

In this scenario, the Partner provides MGID with a user synchronization URL. The Partner's sync endpoint must accept the MGID user ID and redirect the request back to the MGID sync endpoint.

MGID expects:

1. The Partner's cookie sync URL.
2. The Partner's user ID to be passed to the MGID sync endpoint.

*Example:*

```
https://partnerURL.com/sync?gdpr={GDPR}&gdpr_consent={GDPR_CONSENT}&gpp=${GPP_STRING}&gpp_sid=${GPP_SID}&redirect_url=https://cm.mgid.com/m?cdsp=123456&c={user.id}
```

- **The flow is:** MGID - Partner - MGID

The Partner stores the mapping between the MGID user ID and the Partner user ID.

**2. MGID initiates the sync, and only the Partner stores the mapping**

In this scenario, MGID initiates the synchronization by calling the Partner's sync URL.

MGID passes its user ID to the Partner using the user\_id parameter.

*Example:*

```
https://partnerURL.com/sync?user_id={muidn}&gdpr={GDPR}&gdpr_consent={GDPR_CONSENT}&gpp=${GPP_STRING}&gpp_sid=${GPP_SID}
```

The Partner is responsible for storing the mapping between the MGID user ID and the Partner user ID.

- **The flow is:** MGID - Partner

**3. Partner initiates the sync, and MGID stores the mapping**

In this scenario, the Partner initiates the synchronization by calling the MGID sync endpoint.

The Partner should provide:

- its own user ID using the {user.id} macro;
- its redirect URL using the adu parameter.

*Example:*

```
https://cm.mgid.com/m?cdsp=123456&c={user.id}&gdpr={GDPR}&gdpr_consent={GDPR_consent_string}&gpp=${GPP_STRING}&gpp_sid=${GPP_SID}&adu=https://partnerRedirectUR.com/sync?user_id={muidn}
```

- **The flow is:** Partner - MGID - Partner

MGID stores the mapping between the MGID user ID and the Partner user ID.

### Macros and Parameters

| **Parameter / Macro** | **Description** |
| --- | --- |
| {GDPR} | 0 if the user is not subject to GDPR; 1 if the user is subject to GDPR. |
| {GDPR\_CONSENT} | IAB consent string when the request is subject to GDPR. |
| ${GPP\_STRING} / ${GPP\_SID} | GPP consent string and the corresponding GPP section IDs when applicable. |
| {user.id} | Platform-specific user identifier. In the Partner context, this represents the Partner's user ID. |
| {muidn} | MGID-specific user identifier. |

 

### Result in Bid Requests

Once the user IDs have been successfully matched, MGID includes both identifiers in the Bid Request:

- user.id - MGID user ID
- user.buyeruid - Partner/DSP user ID

If no matching record exists, MGID sends only user.id.

### Choosing the Integration Scenario

The appropriate scenario depends on:

- which platform initiates the synchronization;
- whether MGID stores the user ID mapping;
- whether the Partner stores the user ID mapping.

If you are unsure which scenario is applicable to your integration, contact your MGID technical representative before implementing the sync.

 

 

- [Advertisers](https://help.mgid.com/advertisers?hsLang=en#main-content)

    - [Get started with MGID Ads](https://help.mgid.com/advertisers?hsLang=en#get-started-with-mgid-ads)
    - [Campaign Setup & Management](https://help.mgid.com/advertisers?hsLang=en#campaign-setup-management)
    - [CPA Tune](https://help.mgid.com/advertisers?hsLang=en#cpa-tune)
    - [Conversion tracking: general](https://help.mgid.com/advertisers?hsLang=en#conversion-tracking-general)
    - [Tracking with MGID Pixel](https://help.mgid.com/advertisers?hsLang=en#tracking-with-mgid-pixel)
    - [Postback & Trackers](https://help.mgid.com/advertisers?hsLang=en#postback-trackers)
    - [Affiliate Networks Integration](https://help.mgid.com/advertisers?hsLang=en#affiliate-networks-integration)
    - [Webhook tracking method & Integrations](https://help.mgid.com/advertisers?hsLang=en#webhook-tracking-method-integrations)
    - [Native integrations](https://help.mgid.com/advertisers?hsLang=en#native-integrations)
    - [Ad Creatives Management](https://help.mgid.com/advertisers?hsLang=en#ad-creatives-management)
    - [Campaign Optimization & Performance](https://help.mgid.com/advertisers?hsLang=en#campaign-optimization-performance)
    - [FAQ](https://help.mgid.com/advertisers?hsLang=en#faq)
    - [MGID Video Guides](https://help.mgid.com/advertisers?hsLang=en#mgid-video-guides)
- [Publishers](https://help.mgid.com/publishers?hsLang=en#main-content)

    - [General](https://help.mgid.com/publishers?hsLang=en#general)
    - [Prohibited content and practices](https://help.mgid.com/publishers?hsLang=en#prohibited-content-and-practices)
    - [Types of integration](https://help.mgid.com/publishers?hsLang=en#types-of-integration)
    - [Compliance](https://help.mgid.com/publishers?hsLang=en#compliance)
    - [Payment](https://help.mgid.com/publishers?hsLang=en#payment)
    - [FAQ](https://help.mgid.com/publishers?hsLang=en#faq)
- [Ad Quality Policies and Creative Guidelines](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#main-content)

    - [Ad Approval & Compliance Guidelines](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#ad-approval-compliance-guidelines)
    - [Creative AI Hub](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#creative-ai-hub)
    - [Creative Hub](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#creative-hub)
    - [Compliance & Security](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#compliance-security)
- [Advertisers Super Client Account](https://help.mgid.com/advertisers-super-client-account?hsLang=en#main-content)

    - [Clients](https://help.mgid.com/advertisers-super-client-account?hsLang=en#clients)
- [Fraud Prevention](https://help.mgid.com/fraud-prevention?hsLang=en#main-content)

    - [Fraud Prevention](https://help.mgid.com/fraud-prevention?hsLang=en#fraud-prevention)
- [API](https://help.mgid.com/api?hsLang=en)
- [DSP](https://help.mgid.com/dsp?hsLang=en)
- [SSP](https://help.mgid.com/ssp?hsLang=en)

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)

[![Chill listening crop-3](https://help.mgid.com/hubfs/MGID_Logo_Icon_HC.svg "Chill listening crop-3")](https://www.mgid.com)

Native performance through innovation

<https://facebook.com/mgidglobal/> <https://twitter.com/mgid/> <https://www.linkedin.com/company/mgid-inc->

Copyright © 2026, MGID Inc.