> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/integrations-marketingtools/pinterest-ads/setting-up-client-side-pinterest-ads-tracking-with-deduplication.md).

# Setting up client-side Pinterest Ads tracking with deduplication

Setting up client- and server-side tagging for Pinterest Ads with event\_id deduplication

Running both server-side and client-side tagging means Pinterest receives the same conversion twice: once from the browser and once from your server. Deduplication is what stops that from being counted twice. It works when both events carry the **same event name** and the **same event\_id**.&#x20;

So the goal throughout this guide is that your Pinterest Tag, your GA4 tag and your server-side Pinterest Conversions API tag all describe the same interaction with the same event ID.

### Before you start

Make sure you have:

* [ ] A working [server-side Pinterest Conversion API setup](/integrations-marketingtools/pinterest-ads.md).
* [ ] Your **Pinterest Tag ID**. See [How to find your Pinterest Tag ID](/integrations-marketingtools/pinterest-ads/where-to-find-the-pinterest-tag-id-advertiser-id-and-api-token.md).
* [ ] A **Unique Event ID** variable in your web container.

### Step 1: Create a variable for your Pixel ID

1. Open your GTM **web** container and go to **Variables**.
2. Create a new **User-Defined Variable** and choose **Constant** as the variable type.
3. Enter your Pinterest Tag ID as the value and save the variable.

{% hint style="info" %}
Using a constant variable rather than typing the ID into each tag means you only have one place to change it later.
{% endhint %}

### Step 2: Create your Pinterest Base Code tag

1. Go to **Tags** and create a new tag. Select the **Pinterest Tag** as the tag configuration.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FBscPWVXahmDqtt2sRWCz%2Fimage.png?alt=media&amp;token=a01cad30-f1d7-4f15-a3be-02886cea503a" alt=""><figcaption></figcaption></figure>

2. In the **Tag ID** field, select your Tag ID variable.
3. As the **Event to Fire** select **Base Code Only (no event)**.&#x20;
4. Give this tag the trigger you use for all pages (Page View / cookie\_consent\_update)

### Step 3: Create the conversion tags

1. Create a new tag, select the **Pinterest Tag** as tag configuration.
2. Fill in the **Pinterest Tag ID** variable.
3. As the **Event to Fire** indicate whether this is a standard or a custom event. Select a standard event from the dropdown menu, or type a custom event name into the input field.
4. Select **Custom Parameters** under **Additional Parameters**. Add **event\_id** as parameter name and your Unique Event ID variable as the value.
5. As the trigger, select the same trigger you use for the GA4 event tag covering this interaction.
6. Save the tag. And repeat for the other events and conversions you want to set up.

{% hint style="warning" %}
Don't forget to set up the page\_view tag, and use the same trigger as your GA4 page\_view event tag.
{% endhint %}

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2Fe7gZuiCmIuEVNFfgHM2v%2Fimage.png?alt=media&amp;token=c83633e0-a9bb-4b6a-882d-93d7d641a05d" alt=""><figcaption></figcaption></figure>

### Step 4: Add the event\_id to your GA4 events

Your GA4 event tags are what feed the server container, so the event ID has to travel with them. For every interaction you want to deduplicate, add your **Unique Event ID** variable as an event\_id event parameter on the GA4 event tag that fires on that interaction.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2F0BpvIPXyTvkYHyJ7C8QB%2Fimage.png?alt=media&amp;token=3347dd2c-d02c-42e2-b5cd-a0c12191dc2e" alt=""><figcaption></figcaption></figure>

### Step 5: Test and Verify

Open Google Tag Manager's preview mode to check whether the event\_id in the client-side TikTok Event tag matches the server-side TikTok Events API tag. If this is not the case, the usual causes are:

* The event names do not match. The Pixel sends one name and the server-side tag sends another.
* The event IDs do not match, or the server-side tag receives no event ID at all.
* The two tags fire on different triggers, so they never describe the same interaction.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.adpage.io/integrations-marketingtools/pinterest-ads/setting-up-client-side-pinterest-ads-tracking-with-deduplication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
