From beff248a697284f2570bf1a1237ea44bfdbaeede Mon Sep 17 00:00:00 2001 From: Thomas Gilbert Date: Mon, 25 Mar 2024 15:29:11 -0400 Subject: [PATCH 1/2] add section for sending consent data --- .../destinations/catalog/appsflyer/index.md | 116 +++++++++++++----- 1 file changed, 86 insertions(+), 30 deletions(-) diff --git a/src/connections/destinations/catalog/appsflyer/index.md b/src/connections/destinations/catalog/appsflyer/index.md index 9fce94cd2f..92e0428397 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 serverside, simply 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 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 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/)). + ## Install Attributed ### Client From c862d611d4308185f640e7cf8372949283a1d2aa Mon Sep 17 00:00:00 2001 From: Thomas Gilbert <64277654+tcgilbert@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:37:56 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: forstisabella <92472883+forstisabella@users.noreply.github.com> --- .../destinations/catalog/appsflyer/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/connections/destinations/catalog/appsflyer/index.md b/src/connections/destinations/catalog/appsflyer/index.md index 92e0428397..b369b36dc5 100644 --- a/src/connections/destinations/catalog/appsflyer/index.md +++ b/src/connections/destinations/catalog/appsflyer/index.md @@ -132,7 +132,7 @@ To activate this feature, simply input your S2S token in the destination setting ### Send User Consent Preferences Server-side -To transmit user consent data serverside, simply 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 documentation](https://dev.appsflyer.com/hc/reference/s2s-events-api3-post){:target="_blank”}. +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 @@ -188,31 +188,31 @@ analytics.track({ ## 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: +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. +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. +**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: +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. +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. +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. -Finally, Segment uses AppsFlyer's `transactionId` deduplication when you send an `orderId` (see the [e-commerce spec](/docs/connections/spec/ecommerce/v2/)). +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