# StackAdapt Quick Start Guide

## Destination Info

* Supports [Track](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#track) calls
* Supports [HIPAA mode](https://documentation.freshpaint.io/hipaa-mode)
* Supports forwarding from the [Google Tag Manager Integration](/integrations/google-tag-manager-integration.md)
* Supports [Audience retargeting, lookalikes, and exclusions](https://documentation.freshpaint.io/audiences/audience-integrations/stackadapt-audiences)
* Refer to this destination as **StackAdapt** in the [Integrations object](https://documentation.freshpaint.io/reference/developer/freshpaint-sdk-reference#using-the-integrations-object)
* Connection Modes:

<table><thead><tr><th width="249.33333333333331" align="right"> </th><th width="223" data-type="checkbox">Client-side</th><th data-type="checkbox">Server-side</th></tr></thead><tbody><tr><td align="right">Web</td><td>false</td><td>true</td></tr><tr><td align="right">Mobile</td><td>false</td><td>true</td></tr><tr><td align="right">Server</td><td>false</td><td>true</td></tr></tbody></table>

## Getting Started

### Configure Freshpaint destination

1. Make sure you have the appropriate access in both Freshpaint and StackAdapt:
   1. Contact your Freshpaint Account Manager to request access to this destination. Once you have that, we will help you step by step through the configuration process.
2. Create your conversion funnel, and create events in Freshpaint to track your conversions.
3. Since StackAdapt only uses unique click IDs and Conversion Event IDs, there is no access token or Pixel ID required to set up the destination.
   1. You can configure your [StackAdapt destination](https://app.freshpaint.io/destinations/apps/stackadapt) in Freshpaint by using the link provided here or by navigating to **Apps** > **StackAdapt** > **Configure** **StackAdapt** in the Freshpaint console.
   2. In the destination, click the **Configure** button on the Configuration row and click **Save**.

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

Once you've [enabled](https://documentation.freshpaint.io/readme/setting-up-your-destinations/enabling-and-disabling-a-destination) the destination, you're ready to start setting up the campaign and conversion events in StackAdapt!

### Configure Conversion Events

To send a conversion event to StackAdapt, you need to set up an event in StackAdapt and map your Freshpaint event to that event unique ID.

#### In StackAdapt:

1. From the StackAdapt Pixel page, click **Create New** and select **Conversion Event**.
2. Select **Website** as the Install Location and **Page Load** as the Activation Method (even if you're not targeting page loads).
3. Select **Standalone Pixel** as the install method, leaving the default of Javascript.
4. Give your event a name, select the appropriate Conversion Category, and fill out any other fields relevant to the conversion event. Select **Create Pixel Code** once finished.
5. Click **Finish**, ignoring the autogenerated Javascript code. Copy the Conversion Event **Unique ID** for the newly created event once back on the Conversion Events dashboard.

{% hint style="info" %}
When setting up a  conversion event in StackAdapt, you can select either 'click-through' or 'view-through and click-through'. 'View-through and click-through' is the default setting. When the default setting is enabled, the platform will attribute to both impressions and clicks. You convert the event in StackAdapt from 'click-through' to a 'view-through & click-through' at anytime.
{% endhint %}

#### To send an event to StackAdapt, you'll need to [enable the destination](https://app.gitbook.com/o/-MA7b_ezO9UcpNU5sTg_/s/-MA7aDqsXMFbUsWVqonF/~/changes/1124/readme/setting-up-your-destinations/enabling-and-disabling-a-destination) for the event in Freshpaint:

1. If you'd like to send an autotrack event from your event library to StackAdapt, navigate to your Freshpaint event definition and toggle the destination on to enable the event to be sent to StackAdapt. You'll follow the steps below to add the Conversion Event Unique ID. If you're using Google Tag Manager, you can skip to step 2 below.

   1. Return to the StackAdapt Destination in the Freshpaint console and configure a transformation to map one of your Freshpaint events to the StackAdapt Conversion Event. Click "Configure" next to "Event Transformations".
   2.

   ```
   <figure><img src="/files/kWeMHLNjGGRoGMJoguM1" alt=""><figcaption></figcaption></figure>
   ```

   3. Click "**+ New Transformation**"
   4.

   ```
   <figure><img src="/files/lVeuLObbgGQ5jPgwgZoi" alt=""><figcaption></figcaption></figure>
   ```

   5. Select "**Modify Data**". Choose the event you'd like to send to StackAdapt, select the **StackAdapt** destination, click "**Enable it?**" if the event is not yet configured for StackAdapt, and click Save.
   6.

   ```
   <figure><img src="/files/FLIvsGk426LX8WLGd3tJ" alt=""><figcaption></figcaption></figure>
   ```

   7. Once in the transformation edit page, add a new transformation of type Send Constant Property&#x20;

      <div data-full-width="true"><figure><img src="/files/RWyXQrYfsDopz7W6OUEi" alt="" width="375"><figcaption></figcaption></figure></div>
   8. Set the Property Value to the Conversion Event Unique ID (copied from the StackAdapt Conversion Events page), the Constant Type to Text, and the Property Name to `conversion_id`.

   <figure><img src="/files/8BmHX4bpBc9ClTiWPGx6" alt="" width="375"><figcaption></figcaption></figure>

2. If you're using Google Tag Manager to send data to StackAdapt, you'd simply create a tag with the Freshpaint tag template in Google Tag Manager and select the tag type "StackAdapt". In this case, you just need to specify StackAdapt Conversion Event Unique ID in the event tag, no transformation necessary.

Once you've set up the transformation with the StackAdapt Conversion Event Unique ID, you're ready to start sending events to StackAdapt via Freshpaint!

### Configuring StackAdapt for View-Through Conversions using the Freshpaint Impression Pixel

For tracking view-through conversions with StackAdapt, we recommend using the [Freshpaint Impression Pixel](/integrations/impression-pixel.md).

{% hint style="info" %}
The Freshpaint platform previously supported doing view-through reallocation on StackAdapt directly by sending all potential conversions along with their IP. To ensure there's no disruption in conversion data, this legacy behavior continues to work if the impression pixel is not enabled and IP addresses are allowlisted. We recommend customers move to using the impression pixel as it minimizes the amount of data that needs to be sent to third parties and better ensures user privacy and compliance.
{% endhint %}

1. Enable and the Freshpaint Impression Pixel for the StackAdapt destination. Copy the pixel configuration URL to your clipboard.

   <figure><img src="/files/suCmHBg3UbSWN8RZcoL5" alt=""><figcaption></figcaption></figure>
2. In your StackAdapt account, go to the campaign(s) you wish to enable view-through tracking on, and add the URL copied in step one to "Impression Tracking URLs"

   <figure><img src="/files/VQKdTgW7Zl7sklo95cp4" alt=""><figcaption></figcaption></figure>
3. Save the changes to your campaign.

### If you are a HIPAA account, you will need to add event properties to the allowlist. If you are not a HIPAA account, you can skip this step.

Freshpaint has the properties needed for StackAdapt conversion events listed under Required Properties. There are additional properties needed for Retargeting events listed under Recommended Properties.

**Property Requirements:**

* Conversion Events: `conversion_id`, `$sapid`
* Retargeting Events: `retargeting_id`, `$ip`, `$user_agent`

<figure><img src="/files/91ZUoK4MpF3gPJGCTXB1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
When setting up a  conversion event in StackAdapt, you can select either 'click-through' or 'view-through and click-through'. 'View-through and click-through' is the default setting. When the default setting is enabled, the platform will attribute to both impressions and clicks. You convert the event in StackAdapt from 'click-through' to a 'view-through & click-through' at anytime.
{% endhint %}

### Set up Test Campaign and Configure in StackAdapt

1. Set up a test campaign that targets a small audiences and set a low budget ($10-50 budget).
2. In order for Freshpaint to be able to automatically capture the click ID auto-generated by the StackAdapt advertisement, the click ID needs to be specified as a macro in the campaign Click URL.
   1. Navigate to the Overview tab in the StackAdapt portal, and click on your campaign. Click on the Creative tab and add `sapid={SA_POSTBACK_ID}` as a query parameter to your Click URL. A preview of the query parameters will show up under the Click URL that you can use to confirm that the query parameters are properly configured.
3. Verify in Freshpaint that the events triggering and flowing through to successfully to StackAdapt by using Freshpaint's [Liveview and Event Verification tools](https://documentation.freshpaint.io/admin-panel/investigate-testing-and-debugging)

### Confirm events are triggering and sending to StackAdapt successfully&#x20;

To check whether StackAdapt is receiving events, you can go to **Pixel > Conversion Events** within your StackAdapt account, which will show you when the last time StackAdapt received an event for each Conversion Event.

{% hint style="info" %}
Conversions may take up to 2 hours to appear in your StackAdapt portal
{% endhint %}


---

# 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/stackadapt/stackadapt.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.
