# theTradeDesk with CM360 Configuration Guide

{% hint style="warning" %}
These instructions assume that you have already set up theTradeDesk destination in Freshpaint. If you have not yet done so, please refer to [theTradeDesk Quick Start Guide](/integrations/destinations/demand-side-platforms-dsps/thetradedesk/thetradedesk-quick-start-guide.md).

Please note that configuring the CM360 destination in Freshpaint is not required in order to send events to theTradeDesk.
{% endhint %}

## Introduction

theTradeDesk is able to use Google Campaign Manager 360 as the Ad Tech platform to manage campaigns. When theTradeDesk and Google Campaign Manager 360 are integrated with each other, some changes to the Google Campaign Manager 360 configuration are required to allow Freshpaint to collect the necessary parameters to perform ad optimization. This guide walks through the changes that are required.

{% hint style="info" %}
This guide assumes theTradeDesk and Google Campaign Manager 360 accounts are already integrated with each other. If Google Campaign Manager 360 and theTradeDesk are not already configured to work together, please configure them first as per the recommendations of theTradeDesk.
{% endhint %}

### Click-Through Conversions

Click-through conversions occur when a visitor clicks on an ad that is shown to them and is taken to a landing page configured within the creative. Campaigns in theTradeDesk may have limited or no click-through activity. If you expect click-through activity to occur, Campaign Manager 360 can be configured to append a unique identifier for the ad impression to the landing page URL. If Freshpaint is installed on the landing page, then Freshpaint can capture the impression id to be used if the website visitor converts.

### View-Through Conversions

View-through conversions occur when a visitor views an ad and then sometime later visits a website and converts. Freshpaint is able to attribute view-through conversions if CM360 is configured to show an impression pixel when ads are served. This allows Freshpaint to track an ad impression, and do attribution when a conversion event is processed by Freshpaint servers.

#### Methods of Attribution

Freshpaint currently supports two methods for identifying if a website visitor has viewed an ad:

1. IP Address - An Internet Protocol address is the address used by computers to communicate with each other over the internet. Internet Protocol addresses have some limitations in that they do not uniquely identify a device, and many devices can share a particular address, or change their addresses at various times. Because of this IP address based matching will have an associated error rate, with both false positives and false negatives occurring. Freshpaint does not currently have any estimates on how accurate IP address based matching is.\
   \
   If you are showing ads on Connected TV devices, in Freshpaint's experience it is rare for the conversion to occur on the Connected TV itself. In this case Freshpaint recommends use of IP address based attribution for advertising campaigns targeted at connected TV.
2. Cookie - A cookie is a small piece of information that can be set on a web browser that the web browser will then include in each web request made to our servers afterwards. When an ad is viewed, the Freshpaint impression pixel can set a unique browser identity as a cookie in the visitors web browser. When the visitor later lands on a website and converts, the unique identity is used to look up any ad impressions that were seen by the same device and browser.\
   \
   Using cookie based matching is only recommended in advertising campaigns where the user is expected to convert on the same device and web browser as was shown the ad. If a user converts on a different device or web browser than was shown the cookie will not match. Some web browsers such as Firefox and Safari block the required cookie functionality for attribution to occur.

{% hint style="info" %}
IP address and Cookie attribution can both be enabled.
{% endhint %}

{% hint style="info" %}
Freshpaint performs attribution in the following order:

1. Click-through
2. Cookie
3. IP Address

View-through attribution will only fire if a click-through isn't detected. If the Cookie is disabled or a match isn't found, than IP address will be attempted.
{% endhint %}

#### Conversion Windows

When configuring View-through conversions in Freshpaint a conversion window is used to select how far back an event should look for a matching ad impression. When a conversion event is processed by Freshpaint, it will use the conversion window to select only ad impressions that have occurred within the configured number of days.

If there are multiple impressions that match, only the most recent will be used.&#x20;

{% hint style="info" %}
The attribution ordering described above applies to the attribution window. As an example, we have a cookie impression 5 days ago and an IP address impression 1 day ago.

If the conversion window is configured as 10 days, than the attribution will select the IP address match from 5 days ago, because a cookie match is preferred of an IP address match even if the IP address based impression is more recent.

If the conversion window is configured as 3 days ago, the attribution will select the IP address based impression, because the Cookie based impression is outside the conversion window and that leaves only the IP address based impression as valid.
{% endhint %}

{% hint style="info" %}
Changes to the conversion window configuration in a destination will take effect immediately once saved.
{% endhint %}

## Configuration

### Common Configuration

The following configuration is required whether you are doing Click-through or View-through conversions within CM360.

1. Log into Campaign Manager 360&#x20;
2. Navigate to the Campaign you want to configure.
3. Edit a placement you want to enable click-through for
4. Expand `Tag defaults`
5. Add an additional key-values entry of
   1. Key: `ttdimp`
   2. Value: `%%TTD_IMPRESSIONID%%`

<figure><img src="/files/oDPlTByRCcOuv8ePC1zj" alt=""><figcaption></figcaption></figure>

### Configuring Click-through

The following configuration is required within CM360 to enable Click-through conversion attribution.

1. Log into Campaign Manager 360&#x20;
2. Configure the Advertiser to impact all ads or navigate to an individual Ad.
   1. Advertiser: Navigate to the Advertiser Properties and set the Landing page URL suffix to `ttdimp=%pttdimp=!;`

      <figure><img src="/files/73JYgx9pXeFMbeEN6i2C" alt=""><figcaption></figcaption></figure>
   2. Ad: Navigate to the campaign you want to configure and configure the Ad(s) you want to configure. Add the `ttdimp=%pttdimp=!;`macro to the landing page URL to set the ttdimp URL parameter to the landing page.&#x20;

      1. Examples:&#x20;
         1. <https://example.com>?<mark style="color:green;">ttdimp=%pttdimp=!;</mark>
         2. <https://example.com?utm\\_campaign=example-campaign&><mark style="color:green;">ttdimp=%pttdimp=!;</mark>

      <figure><img src="/files/r3PT3aoFXdfsbtBKvpvE" alt=""><figcaption></figcaption></figure>

### Configuring View-through

#### Freshpaint Configuration

1. Ensure you have a destination configured as per [theTradeDesk Quick Start Guide](/integrations/destinations/demand-side-platforms-dsps/thetradedesk/thetradedesk-quick-start-guide.md)
2. Navigate to the destination settings configuration page

   <figure><img src="/files/WdDEfQwyQwvpyEBpE5yA" alt=""><figcaption></figcaption></figure>
3. Select Configure for the Freshpaint Impression Pixel
4. Enable the Matching options you wish to use and set the number of days for the conversion window

   <figure><img src="/files/z0eQUmzcLQLC15jdtu16" alt=""><figcaption></figcaption></figure>
5. Select Copy next to the CM360 Pixel URL to copy the impression pixel URL that will need to be configured in CM360

{% hint style="warning" %}
The configuration dialog provides URLs for when configuring the Pixel on theTradeDesk and a separate URL when configuring CM360. Make sure to use the "CM360 Pixel URL".
{% endhint %}

#### CM360 Configuration

The Freshpaint Impression Pixel can be configured as an advertiser or campaign event tag.&#x20;

1. If configuring at the Advertiser level, navigate to the Advertiser Properties and open the Event tags configuration.
2. If configuring at the campaign level, navigate to the Campaign Properties and open the Event tags configuration.
3. Create a new impression event tag
   1. For Tag type, select Image
   2. For Tag URL, copy the URL retrieved from Freshpaint above

<figure><img src="/files/hT4yNknvEMCrPsR0sPQn" alt=""><figcaption></figcaption></figure>

#### Testing the CM360 Configuration

Whether CM360 is correctly configured can be tested independent of theTradeDesk by exporting the tags.&#x20;

1. Navigate to the Campaign you want to verify
2. In the upper right corner Select Tags > Download Tags

   <figure><img src="/files/Nb2gcRTRbpARO3ynLmdR" alt=""><figcaption></figcaption></figure>
3. In the download page
   1. Select HTML as the Format
   2. Select the placements you want to verify
   3. Click Download
4. Open the downloaded file in a web browser
5. Copy one of the tags that looks like `<ins class...`
6. Use an advertising tag testing tool such as <https://www.w3schools.com/html/tryit.asp> and paste the tag somewhere in the body of the page.
7. Change the `%%TTD_IMPRESSIONID%%` to be a value, such as 1234

   <figure><img src="/files/KzrPAkqu2GTZvt7iaJ98" alt=""><figcaption></figcaption></figure>

**To test click-through**

1. In the w3school tool select `Run` to generate the website with the embedded advertisement
2. Click on the ad
3. Check that the URL on the landing page contains the text ttdimp=\<value> where value is what you set above.

   <figure><img src="/files/RlwrvvbGNGaLY650L7dz" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Some landing pages are configured to redirect the browser to another page. If Freshpaint is installed on the landing page it will automatically capture the ttdimp property from the URL, but the URL you see may not show the ttdimp=\<value>. This is working as expected as Freshpaint will save the ttdimp value.

If Freshpaint is not installed on your landing page that redirects, you will need to coordinate with your web team to ensure the landing page when redirecting the user also forwards the ttdimp parameter to the next page with Freshpaint installed.
{% endhint %}

**To test view-through**

{% hint style="info" %}
If you are not familiar with the dev tools of you're browser you can find more information here: <https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Tools_and_setup/What_are_browser_developer_tools>
{% endhint %}

1. Open the browser Dev Tools and select the network tab.
2. In the w3school tool select `Run` to add the tag to the page on the right
3. Look for an HTTP request that goes to <https://freshpaint-impression.com/pixel.png> and includes $ttdimp=\<value> where the value is what you selected above.

   <figure><img src="/files/BFepMbCsvLlBVtPYEQQe" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://documentation.freshpaint.io/integrations/destinations/demand-side-platforms-dsps/thetradedesk/thetradedesk-with-cm360-configuration-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
