diff --git a/src/connections/destinations/catalog/appsflyer/index.md b/src/connections/destinations/catalog/appsflyer/index.md index 9fce94cd2f..b369b36dc5 100644 --- a/src/connections/destinations/catalog/appsflyer/index.md +++ b/src/connections/destinations/catalog/appsflyer/index.md @@ -62,7 +62,7 @@ To prevent this, you can enable the new **Fallback to send IDFV when advertising {% include content/react2-dest.md %} -### Server +## Server AppsFlyer offers an **augmentative** server-side [HTTP API](https://support.appsflyer.com/hc/en-us/articles/207034486-Server-to-Server-In-App-Events-API-HTTP-API-){:target="_blank"} intended for use along side the AppsFlyer mobile SDK. Use the cloud-mode destination _with_ the mobile SDK to link out-of-app events (such as website or offline purchases) with attributed users and devices. @@ -70,35 +70,7 @@ AppsFlyer offers an **augmentative** server-side [HTTP API](https://support.apps If you want to use AppsFlyer server-side only, contact your AppsFlyer representative, as this is an Enterprise Customer Feature. -## Identify - -If you're not familiar with the Segment Specs, take a look to understand what the [Identify method](/docs/connections/spec/identify/) does. An example iOS call would look like: - -```swift -[[SEGAnalytics sharedAnalytics] identify:@"12091906-01011992" - traits:@{ @"email": @"john.doe@example.com" }]; -``` - -When you call `.identify()`, Segment uses AppsFlyer's `setCustomerUserID` to send the `userId` that was passed in. - -**Note:** `identify` calls are not supported using AppsFlyer's HTTP API at the moment. You can only send `.identify` calls if you have the AppsFlyer SDK bundled. - -## Track - -If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/connections/spec/track/) does. An example iOS call would look like: - -```swift -[[SEGAnalytics sharedAnalytics] track:@"Article Completed" - properties:@{ @"title": @"How to Create a Tracking Plan", @"course": @"Intro to Analytics" }]; -``` - -When you call `track`, Segment translates it automatically and sends the event to AppsFlyer. - -Segment includes all the event properties as callback parameters on the AppsFlyer event, and automatically translate `properties.revenue` to the appropriate AppsFlyer purchase event properties based on the spec'd properties. - -Finally, Segment uses AppsFlyer's `transactionId` deduplication when you send an `orderId` (see the [e-commerce spec](/docs/connections/spec/ecommerce/v2/)). - -### Server +### Configuring Server-side Delivery If you'd like to attribute offline events with a certain user or device, the server-side destination may be employed. @@ -158,6 +130,90 @@ When transmitting data serverside to Appsflyer, you have the option to enhance s To activate this feature, simply input your S2S token in the destination settings and toggle the "Use API v3" switch to the enabled position. +### Send User Consent Preferences Server-side + +To transmit user consent data server-side, incorporate the consent preferences into the `integrations.AppsFlyer.consent_data` object. This can be done in either TCF or manual format, as outlined in [the AppsFlyer Send Event documentation](https://dev.appsflyer.com/hc/reference/s2s-events-api3-post){:target="_blank”}. + +```js +// node.js library example with tcf +analytics.track({ + event: 'Membership Upgraded', + userId: '97234974', + context: { + device: { + type: 'ios', + advertisingId: '159358' + } + }, + integrations: { + AppsFlyer: { + appsFlyerId: '1415211453000-6513894' + }, + consent_data: { + tcf: { + tcstring: "string", + cmp_sdk_version: 1, + cmp_sdk_id: 1, + gdpr_applies: 0, + policy_version: 1 + } + } + } +}); + +// node.js library example with manual consent +analytics.track({ + event: 'Membership Upgraded', + userId: '97234974', + context: { + device: { + type: 'ios', + advertisingId: '159358' + } + }, + integrations: { + AppsFlyer: { + appsFlyerId: '1415211453000-6513894' + }, + consent_data: { + manual: { + ad_personalization_enabled: 'true', + ad_user_data_enabled: 'true', + gdpr_applies: 'true' + } + } + } +}); +``` + +## Identify + +If you're not familiar with the Segment Spec, take a look to understand what the [Identify method](/docs/connections/spec/identify/) does. An example iOS call would look like: + +```swift +[[SEGAnalytics sharedAnalytics] identify:@"12091906-01011992" + traits:@{ @"email": @"john.doe@example.com" }]; +``` + +When you call Identify, Segment uses AppsFlyer's `setCustomerUserID` to send the `userId` that was passed in. + +**Note:** Identify calls are not supported using AppsFlyer's HTTP API at the moment. You can only send `.identify` calls if you have the AppsFlyer SDK bundled. + +## Track + +If you're not familiar with the Segment Spec, take a look to understand what the [Track method](/docs/connections/spec/track/) does. An example iOS call would look like: + +```swift +[[SEGAnalytics sharedAnalytics] track:@"Article Completed" + properties:@{ @"title": @"How to Create a Tracking Plan", @"course": @"Intro to Analytics" }]; +``` + +When you call Track, Segment translates it automatically and sends the event to AppsFlyer. + +Segment includes all the event properties as callback parameters on the AppsFlyer event, and automatically translates `properties.revenue` to the appropriate AppsFlyer purchase event properties based on the spec'd properties. + +Segment uses AppsFlyer's `transactionId` deduplication when you send an `orderId` (see Segment's [e-commerce spec](/docs/connections/spec/ecommerce/v2/) for more details). + ## Install Attributed ### Client