Skip to content

Commit 305c07f

Browse files
authored
Merge pull request #6502 from StackAdapt/am/s2s-docs-more-use-cases
Add documentation sections explaining how to track conversions with backend SDKs and reverse ETL
2 parents cc95d60 + a5eeb5f commit 305c07f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
52.6 KB
Loading

src/connections/destinations/catalog/actions-stackadapt/index.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,31 @@ analytics.track('Order Completed', {
139139

140140
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.
141141

142+
### Conversion Tracking with Backend Events
143+
144+
When you send events to Segment from your backend, which are forwarded to StackAdapt using Segment's backend SDKs, the user agent and IP address of the user who originated the event must be included in the event context for conversions to be tracked. StackAdapt uses the user agent and IP address to attribute the conversion to the correct event to a user who has interacted with your ads. Examples of how to do this can be found in the documentation for Segment's SDKs. For example, for the [Python SDK](/docs/connections/sources/catalog/libraries/server/python/#override-context-value) this can be done as follows:
145+
146+
```python
147+
analytics.track('user_id', 'Order Completed', context={
148+
'ip': '203.0.113.1',
149+
'userAgent': 'Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Build/KLP) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30'
150+
})
151+
```
152+
153+
This is necessary when using backend SDKs but not for events sent from the frontend with `analytics.js`, because `analytics.js` automatically includes the user-agent and IP address in the event context.
154+
155+
### Conversion Tracking with Reverse ETL
156+
157+
When sending past events to StackAdapt using a Reverse ETL tool, the user agent, IP address, event type, and either the page URL (for conversion trackers with URL rules), or the fields the event rules match on, must be included in your mappings. For example, the below mapping for a Snowflake source can be used to match a conversion tracker with an event rule that matches an `action` of `User Registered`:
158+
159+
![Image showing Snowflake mapping to forward User Registered events](images/snowflake-mapping.png)
160+
161+
Rows forwarded to StackAdapt with this mapping will be matched by the `User Registered` event rule shown below:
162+
163+
![Image showing event rule in StackAdapt the matches a User Registered event](images/user-registered-event-rule.png)
164+
165+
When forwarding past events using Reverse ETL, only users who have interacted with an ad from an associated campaign within the conversion tracker's configured view-through expiry window (for impressions) or click-through expiry window (for clicks) will count as conversions. These windows can be set to up to 180 days in the conversion tracker configuration.
166+
142167
{% include components/actions-fields.html %}
143168

144169
## Data and privacy

0 commit comments

Comments
 (0)