|
| 1 | +--- |
| 2 | +title: StackAdapt (Actions) Destination |
| 3 | +hide-boilerplate: true |
| 4 | +hide-dossier: true |
| 5 | +beta: true |
| 6 | +--- |
| 7 | + |
| 8 | +{% include content/plan-grid.md name="actions" %} |
| 9 | + |
| 10 | +By setting up StackAdapt as a Segment destination, your Segment events will be forwarded to [StackAdapt](https://www.stackadapt.com/){:target="_blank"}. This allows you to generate retargeting and lookalike audiences, track conversions, and measure return on ad spend using your Segment events - bypassing the need to install the StackAdapt pixel on your website and write code to send events to StackAdapt. |
| 11 | + |
| 12 | +This destination is maintained by StackAdapt. For any issues with the destination, please [submit a ticket to StackAdapt's support team](https://support.stackadapt.com/hc/en-us/requests/new?ticket_form_id=360006572593){:target="_blank"}. |
| 13 | + |
| 14 | +{% include content/ajs-upgrade.md %} |
| 15 | + |
| 16 | +## Getting started |
| 17 | + |
| 18 | +### Getting Your StackAdapt Universal Pixel ID |
| 19 | + |
| 20 | +1. Log in to your StackAdapt account and navigate to the Pixels page. |
| 21 | +2. Above the list of pixels, click the "Install StackAdapt Pixel" link. |
| 22 | + |
| 23 | +  |
| 24 | + |
| 25 | +3. In the instructions that appear, copy the universal pixel ID from the code snippet. Below is an example of a code snippet where the universal pixel ID is `sqQHa3Ob1hFi__2EcYYVZg1`. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +### Setting up the StackAdapt destination in Segment |
| 30 | + |
| 31 | +1. From the Segment web app, click **Catalog**, then click **Destinations**. |
| 32 | +2. Search for "StackAdapt" in the search bar, then click on the Destination "StackAdapt". |
| 33 | +3. Click **Add Destination**. |
| 34 | +4. Select an existing JavaScript Source to connect to TikTok Pixel. |
| 35 | +5. Give the Destination a name. |
| 36 | +6. On the Settings screen, provide your StackAdapt Universal Pixel ID. This can be found on the Pixels page in StackAdapt as described above. |
| 37 | +7. Toggle on the Destination using the **Enable Destination** toggle. |
| 38 | +8. Click **Save Change**. |
| 39 | + |
| 40 | +### StackAdapt Pixel Setup |
| 41 | + |
| 42 | +Segment events that are forwarded to StackAdapt can be used to track ad conversions, and to generate retargeting and lookalike audiences. Please review the StackAdapt documentation for the general setup of these if you are not already familiar: |
| 43 | + |
| 44 | +- [Creating Conversion Events](https://support.stackadapt.com/hc/en-us/articles/360005859214-Creating-Conversion-Events){:target="_blank"} |
| 45 | +- [Creating Retargeting Audiences](https://support.stackadapt.com/hc/en-us/articles/360005939153-Creating-Retargeting-Audiences){:target="_blank"} |
| 46 | +- [How to Generate and Target a Lookalike Audience](https://support.stackadapt.com/hc/en-us/articles/360023738733-How-to-Generate-and-Target-a-Lookalike-Audience){:target="_blank"} |
| 47 | + |
| 48 | +Setup of conversion events, retargeting audiences, and lookalike audiences that fire on Segment events is largely the same as the setup in the StackAdapt documentation, with a few caveats: |
| 49 | + |
| 50 | +1. You **must** select "Universal Pixel" as the pixel type. This is because the StackAdapt destination in Segment uses your Universal Pixel ID to send events to StackAdapt. |
| 51 | +2. There is no need to install the StackAdapt pixel on your website as instructed in the "Installation" step, since Segment will forward events to StackAdapt that would normally be tracked by the StackAdapt pixel. |
| 52 | +3. If you choose to set up event rules, you will need to ensure that you use the event keys supported by the the StackAdapt destination as described below. |
| 53 | + |
| 54 | +### Event Rules |
| 55 | + |
| 56 | +The StackAdapt Segment destination sends an `action` event key which by default is mapped to the Segment event name. Creating rules on this `action` key should be sufficient for most simple event rule use cases. For example, if you fire a Segment event when a user fills out a registration form on your website and want to track this as a conversion event in StackAdapt, you can create a rule in StackAdapt that matches the `action` key with the Segment event name. |
| 57 | + |
| 58 | +A Segment event fired with the code `analytics.track("User Registered")` can be tracked as a conversion event with an event rule that matches an `action` of `User Registered` as shown below: |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +#### Ecommerce Events |
| 63 | + |
| 64 | +The StackAdapt destination also supports forwarding ecommerce fields for the purpose of creating event rules that match ecommerce events, with default mappings to properties specified in the [Segment V2 Ecommerce Event Spec](/docs/connections/spec/ecommerce/v2/) as described in the below table: |
| 65 | + |
| 66 | +| Segment Ecommerce Event Property | StackAdapt Event Key | |
| 67 | +|----------------------------------|----------------------| |
| 68 | +| `order_id` | `order_id` | |
| 69 | +| `revenue` | `revenue` | |
| 70 | +| `product_id` | `product_id` | |
| 71 | +| `category` | `product_category` | |
| 72 | +| `name` | `product_name` | |
| 73 | +| `price` | `product_price` | |
| 74 | +| `quantity` | `product_quantity` | |
| 75 | + |
| 76 | +For events that can involve multiple products, such as checkout events, we forward a JSON array of product objects with a `products` key and fields that map by default to following Segment product array fields: |
| 77 | + |
| 78 | +| Segment Ecommerce Event Property | StackAdapt Product Object Key | |
| 79 | +|----------------------------------|-------------------------------| |
| 80 | +| `products.$.product_id` | `product_id` | |
| 81 | +| `products.$.category` | `product_category` | |
| 82 | +| `products.$.name` | `product_name` | |
| 83 | +| `products.$.price` | `product_price` | |
| 84 | +| `products.$.quantity` | `product_quantity` | |
| 85 | + |
| 86 | +For example, to create a conversion event when an order is completed with a revenue value greater than 10, you could set up an event rule matching an `action` value of `Order Completed` and a `revenue` value greater than 10 as shown below: |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +This rule would match a Segment event fired with code such as: |
| 91 | + |
| 92 | +```javascript |
| 93 | +analytics.track("Order Completed", { |
| 94 | + order_id: '50314b8e9bcf000000000000', |
| 95 | + revenue: 11.5 |
| 96 | + products: [ |
| 97 | + { |
| 98 | + product_id: '507f1f77bcf86cd799439011', |
| 99 | + name: 'Monopoly: 3rd Edition', |
| 100 | + price: 11.5, |
| 101 | + quantity: 1, |
| 102 | + category: 'Games' |
| 103 | + } |
| 104 | + ] |
| 105 | +}); |
| 106 | +``` |
| 107 | + |
| 108 | +### URL Rules |
| 109 | + |
| 110 | +If you are using URL rules, these will be matched whenever Segment sends an event to StackAdapt with a `url` matching the URL rule. This should be accomplished by the page event Segment automatically fires when a page is viewed, so setup of URL rules should be identical to setting up URL rules with the StackAdapt pixel. |
| 111 | + |
| 112 | +{% include components/actions-fields.html %} |
| 113 | + |
| 114 | +## Data and Privacy |
| 115 | + |
| 116 | +Review [StackAdapt's Data Processing Agreement](https://www.stackadapt.com/data-processing-agreement){:target="_blank"} to learn more about StackAdapt's privacy and data terms. |
0 commit comments