From b57a0239b1890adedd59a590d8725d1da75b2df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Tue, 29 Oct 2024 14:19:10 +0100 Subject: [PATCH 01/22] Add Android migration guide --- .../adobe-extension/android/index.mdoc | 217 ++++++++++++++++++ .../sdk/migration/adobe-extension/index.mdoc | 8 + src/declarations.d.ts | 22 +- src/integrations/fetchSdkVersions.ts | 114 ++++----- 4 files changed, 298 insertions(+), 63 deletions(-) create mode 100644 src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc create mode 100644 src/content/docs/en/sdk/migration/adobe-extension/index.mdoc diff --git a/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc new file mode 100644 index 0000000000..6e43884fa2 --- /dev/null +++ b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc @@ -0,0 +1,217 @@ +--- +title: Android Adobe Extension v3 migration guide +description: Follow this guide to migrate from v2 to v3 +sidebar-label: Android v3 migration guide +sidebar-position: 1 +--- + +The Adjust Extension for Adobe Experience SDK has been updated to v3 to support Adjust Android SDK v5. Follow this guide to migrate from v2 to v3. + +## Before you begin {% #before-you-begin %} + +If your app targets API versions lower than [**21**](https://developer.android.com/tools/releases/platforms#5.0) you MUST update your app before migrating. + +## Install the SDK {% #install-the-sdk %} + +To install v3 of the Adjust Android Extension for Adobe, update the dependency declarations in your `build.gradle` as follows: + +1. `com.adjust.adobeextension:adobextension` MUST be updated to 3.0.0 or later. +1. `com.adjust.sdk:adjust-android` MUST be updated to 5.0.0 or later. + +```groovy +dependencies { + implementation 'com.adjust.adobeextension:adobeextension:{% $versions.android_adobe_extension.v3 %}' + implementation 'com.adjust.sdk:adjust-android:{% $versions.android.v5 %}' + implementation 'com.adobe.marketing.mobile:core:3.2.0' + implementation 'com.android.installreferrer:installreferrer:2.2' +} +``` + +## New APIs {% #new-apis %} + +{% minorversion added="v3" size="large" /%} + +The following APIs have been added in v3. + +### Resolve short branded links {% #resolve-short-branded-links %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for resolving [short branded links](https://help.adjust.com/en/article/short-branded-links). Call the `Adjust.processAndResolveDeeplink` method with the following arguments to resolve shortened links: + +{% deflist %} +`adjustDeeplink`: `AdjustDeeplink` + +: The deep link that opened the app. + +`context`: `Context` + +: The app context. Call `getApplicationContext()` to fill this value. + +`callback`: `OnDeeplinkResolvedListener` + +: A callback function that receives the resolved short link as an argument. +{% /deflist %} + +```java +Intent intent = getIntent(); +Uri data = intent.getData(); +AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); +Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() { + @Override + public void onDeeplinkResolved(String s) { + + } +}); +``` + +### Global callback parameters {% #global-callback-parameters %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for the global callback parameters API from Android SDK v5. To add global callbacks to your sessions, call the `Adjust.addGlobalCallbackParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The key of your parameter. + +`value`: `String` + +: The value of your parameter. +{% /deflist %} + +```java +Adjust.addGlobalCallbackParameter("gc_foo", "gc_bar"); +Adjust.addGlobalCallbackParameter("gc_key", "gc_value"); +``` + +### Global partner parameters {% #global-partner-parameters %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for the global partner parameters API from Android SDK v5. To add global partner parameters, call the `Adjust.addGlobalPartnerParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The key of your parameter. + +`value`: `String` + +: The value of your parameter. +{% /deflist %} + +```java +Adjust.addGlobalPartnerParameter("gc_foo", "gc_bar"); +Adjust.addGlobalPartnerParameter("gc_key", "gc_value"); +``` + +### Set external device ID {% #set-external-device-id %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for setting [external device identifiers](https://help.adjust.com/en/article/external-device-identifiers). To set an external device ID, call the `setExternalDeviceId` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`externalDeviceId`: `String` + +: Your external device identifier. +{% /deflist %} + +```java +String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); +config.setExternalDeviceId("{YourExternalDeviceId}"); +AdjustAdobeExtension.setConfiguration(config); +``` + +### Set default link token {% #set-default-link-token %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for setting a default [link token](https://help.adjust.com/en/article/links) for recording preinstalled app installs to a default campaign. To set a default link token, call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`defaultTracker`: `String` + +: The alphanumeric link token of your preinstall campaign. +{% /deflist %} + +```java +String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); +config.setDefaultTracker("{Token}"); +AdjustAdobeExtension.setConfiguration(config); +``` + +## Changed APIs {% #changed-apis %} + +{% minorversion changed="v3" size="large" /%} + +The following APIs have changed in v3. + +### Retrieve device ADID {% #retrieve-device-adid %} + +In SDK v2, the `AdjustAttribution` class has a property called `adid`. In SDK v3, the `adid` property has been removed from the `AdjustAttribution` class. You can retrieve the device's ADID asynchronously by calling `Adjust.getAdid`. + +```java +Adjust.getAdid(new OnAdidReadListener() { + @Override + public void onAdidRead(String adid) { + // Your callback function + } +}); +``` + +### Direct deep linking {% #direct-deep-linking %} + +In SDK v2, you can open deep links for attribution by calling the `AdjustAdobeExtension.openUrl` method with the deep link data as an argument. + +```java +Intent intent = getIntent(); +Uri data = intent.getData(); +AdjustAdobeExtension.openUrl(data, getApplicationContext()); +``` + +SDK v3 has been updated to use the Adjust Android SDK's `processDeeplink` method. To open direct deep links: + +1. Create a new `AdjustDeeplink` instance with the deep link URL. +1. Pass your `AdjustDeeplink` instance to the `Adjust.processDeeplink` method. + +```java +Intent intent = getIntent(); +Uri data = intent.getData(); +AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); +Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); +``` + +### Deferred deep linking callback {% #deferred-deep-linking-callback %} + +In SDK v2, you can configure the SDK to launch a callback function when a deferred deep link is opened by passing a function to the `setOnDeeplinkResponseListener` method of your `AdjustAdobeExtensionConfig` instance. + +```java +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); + +config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { + return true; + } else { + return false; + } + } +}); + +AdjustAdobeExtension.setConfiguration(config); +``` + +In SDK v3, this method has been renamed to `setOnDeferredDeeplinkResponseListener`. + +```java +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); + +config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { + return true; + } else { + return false; + } + } +}); + +AdjustAdobeExtension.setConfiguration(config); +``` diff --git a/src/content/docs/en/sdk/migration/adobe-extension/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/index.mdoc new file mode 100644 index 0000000000..36dbd925d3 --- /dev/null +++ b/src/content/docs/en/sdk/migration/adobe-extension/index.mdoc @@ -0,0 +1,8 @@ +--- +title: Adjust Extension for Adobe Experience SDK +sidebar-label: Adobe Extension +description: Follow these guides to migrate between SDK versions +type: category +sidebar-position: 7 +--- + diff --git a/src/declarations.d.ts b/src/declarations.d.ts index db8ad53842..6661008f29 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -11,7 +11,13 @@ declare type BannerKind = | "negative" | "primary"; -declare type CalloutType = "info" | "note" | "tip" | "warning" | "important" | "seealso"; +declare type CalloutType = + | "info" + | "note" + | "tip" + | "warning" + | "important" + | "seealso"; declare interface ApiObject { orgName: string; @@ -28,15 +34,19 @@ declare interface VersionProps { declare interface VersionMap { [key: string]: string | { - v4: string, - v5: string, - } + [key: string]: string; + }; } -declare type BadgeColor = "neutral" | "negative" | "positive" | "warning" | "primary"; +declare type BadgeColor = + | "neutral" + | "negative" + | "positive" + | "warning" + | "primary"; declare type TableHeights = number | "full-height" | undefined; declare interface MarkdownHeadingWithId extends MarkdownHeading { - id?: String + id?: String; } diff --git a/src/integrations/fetchSdkVersions.ts b/src/integrations/fetchSdkVersions.ts index 3f4cd6a904..cc00f5698f 100644 --- a/src/integrations/fetchSdkVersions.ts +++ b/src/integrations/fetchSdkVersions.ts @@ -8,25 +8,18 @@ type TagNode = { }; }; -// Define the shape of the GraphQL response -type GraphQLResponse = { - v4Tags: { - refs: { - edges: TagNode[]; - }; - }; - v5Tags: { - refs: { - edges: TagNode[]; - }; - }; - latestTag?: { - refs: { - edges: TagNode[]; - }; +// Define the shape of a single version tag response +type VersionTagResponse = { + refs: { + edges: TagNode[]; }; }; +// Make the GraphQL response flexible to handle different version keys (v2, v3, etc.) +type GraphQLResponse = { + [key: string]: VersionTagResponse; +}; + let versionReplacements: VersionMap = { android: { v4: "x.x.x", v5: "x.x.x" }, ios: { v4: "x.x.x", v5: "x.x.x" }, @@ -35,6 +28,10 @@ let versionReplacements: VersionMap = { cordova: { v4: "x.x.x", v5: "x.x.x" }, flutter: { v4: "x.x.x", v5: "x.x.x" }, cocos2dx: { v4: "x.x.x", v5: "x.x.x" }, + android_adobe_extension: { + v2: "x.x.x", + v3: "x.x.x", + }, web: "x.x.x", windows: "x.x.x", }; @@ -49,15 +46,18 @@ export async function fetchVersions() { const fetchPromises = Object.keys(versionReplacements).map( async (platform) => { const currentPlatform = versionReplacements[platform]; + if (typeof currentPlatform === "object") { - const query = ` - query RepositoryTags { - v4Tags: repository(owner: "adjust", name: "${platform}_sdk") { + // Dynamically build query segments for each version (e.g., v2, v3, v4, v5) + const versionQueries = Object.keys(currentPlatform) + .map( + (versionKey) => ` + ${versionKey}Tags: repository(owner: "adjust", name: "${platform}_sdk") { refs( refPrefix: "refs/tags/" orderBy: { field: TAG_COMMIT_DATE, direction: DESC } first: 1 - query: "v4" + query: "${versionKey}" ) { edges { node { @@ -66,55 +66,55 @@ export async function fetchVersions() { } } } - v5Tags: repository(owner: "adjust", name: "${platform}_sdk") { - refs( - refPrefix: "refs/tags/" - orderBy: { field: TAG_COMMIT_DATE, direction: DESC } - first: 1 - query: "v5" - ) { - edges { - node { - name - } - } - } - } - } - `; + `, + ) + .join("\n"); - const response = await octokit.graphql(query); + // Build the full query with all versions for this platform + const query = ` + query RepositoryTags { + ${versionQueries} + } + `; - // Extract the first v4 and v5 tag names - const firstV4Tag = response.v4Tags.refs.edges[0]?.node.name.replace("v", "") || "Not found"; - const firstV5Tag = response.v5Tags.refs.edges[0]?.node.name.replace("v", "") || "Not found"; + const response = await octokit.graphql(query); - currentPlatform.v4 = firstV4Tag; - currentPlatform.v5 = firstV5Tag; + // Extract and store each version's tag name from the response + Object.keys(currentPlatform).forEach((versionKey) => { + const tag = + response[`${versionKey}Tags`]?.refs.edges[0]?.node.name.replace( + "v", + "", + ) || "Not found"; + currentPlatform[versionKey] = tag; + }); } else { + // For non-object platforms, fetch only the latest tag const query = ` - query RepositoryTags { - latestTag: repository(owner: "adjust", name: "${platform}_sdk") { - refs( - refPrefix: "refs/tags/" - orderBy: { field: TAG_COMMIT_DATE, direction: DESC } - first: 1 - query: "v" - ) { - edges { - node { - name - } + query RepositoryTags { + latestTag: repository(owner: "adjust", name: "${platform}_sdk") { + refs( + refPrefix: "refs/tags/" + orderBy: { field: TAG_COMMIT_DATE, direction: DESC } + first: 1 + query: "v" + ) { + edges { + node { + name } } } } - `; + } + `; const response = await octokit.graphql(query); - versionReplacements[platform] = response.latestTag?.refs.edges[0]?.node.name.replace("v", "") || "Not found"; + versionReplacements[platform] = + response.latestTag?.refs.edges[0]?.node.name.replace("v", "") || + "Not found"; } - } + }, ); await Promise.all(fetchPromises); From 6ebdb6c1bd376c297372843454edbc70b907f34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Thu, 31 Oct 2024 15:55:53 +0100 Subject: [PATCH 02/22] Add integration and feature guides --- src/components/DefList.astro | 3 +- .../adobe-extension/android/attribution.mdoc | 61 +++ .../adobe-extension/android/deep-linking.mdoc | 80 +++ .../sdk/adobe-extension/android/events.mdoc | 112 ++++ .../android/external-device-id.mdoc | 26 + .../android/global-parameters.mdoc | 116 +++++ .../en/sdk/adobe-extension/android/index.mdoc | 36 ++ .../adobe-extension/android/integration.mdoc | 477 ++++++++++++++++++ .../adobe-extension/android/preinstalled.mdoc | 35 ++ .../adobe-extension/android/push-tokens.mdoc | 41 ++ .../docs/en/sdk/adobe-extension/index.mdoc | 7 + src/content/docs/en/sdk/migration/index.mdx | 2 +- 12 files changed, 993 insertions(+), 3 deletions(-) create mode 100644 src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/events.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/index.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/integration.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/index.mdoc diff --git a/src/components/DefList.astro b/src/components/DefList.astro index e9625e109f..2d41290ea5 100644 --- a/src/components/DefList.astro +++ b/src/components/DefList.astro @@ -1,7 +1,6 @@ --- -import { decode } from "tiny-decode"; import { parseDefList } from "@components/utils/parseDefList"; -const content = decode(await Astro.slots.render("default")); +const content = await Astro.slots.render("default"); const parsedContent = await parseDefList(content); --- diff --git a/src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc b/src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc new file mode 100644 index 0000000000..135ed03f30 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc @@ -0,0 +1,61 @@ +--- +title: Set up an attribution callback +description: Set up an attribution callback to respond to attribution changes. +sidebar-position: 5 +--- + +When Adjust receives install data from the Adjust Android Extension for Adobe Experience SDK, the device is attributed to the source of the install. This attribution information can change if the user is retargeted or interacts with another campaign. + +You can configure a callback function to respond to attribution changes. When Adjust receives new attribution information, it sends the data asynchronously back to the device. The callback function receives the device's attribution data as an argument. + +See Adjust's [attribution data policies](https://github.com/adjust/sdks/blob/master/doc/attribution-data.md) for more information about attribution data. + +## Reference {% #reference %} + +To set a callback function to listen for attribution changes, call the `setOnAttributionChangedListener` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`onAttributionChangedListener`: `OnAttributionChangedListener` + +: A function that returns `void` and receives device attribution information as a serialized JSON object. +{% /deflist %} + +```java +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); + +config.setOnAttributionChangedListener(new OnAttributionChangedListener() { + @Override + public void onAttributionChanged(AdjustAttribution attribution) {} +}); + +AdjustAdobeExtension.setConfiguration(config); +``` + +## Tutorial {% #tutorial %} + +This tutorial demonstrates how to configure a callback function to do the following: + +1. Log that the attribution information has changed. +1. Log the attribution information as a single string. + +To set up this function, follow these steps: + +1. Create a new `AdjustAdobeExtensionConfig` instance. +1. Call the `setOnAttributionChangedListener` with an `OnAttributionChangedListener` instance as an argument. +1. Within the `OnAttributionChangedListener` declaration, create a new `void` function with an `AdjustAttribution` parameter. +1. Within your `void` function, log out the attribution by casting it as a `String`. +1. Call `AdjustAdobeExtension.setConfiguration` with your `AdjustAdobeExtensionConfig` instance as an argument to initialize the extension. + +```java +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); + +config.setOnAttributionChangedListener(new OnAttributionChangedListener() { + @Override + public void onAttributionChanged(AdjustAttribution attribution) { + Log.d("example", "Attribution information updated"); + Log.d("example", "Attribution: " + attribution.toString()); + } +}); + +AdjustAdobeExtension.setConfiguration(config); +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc b/src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc new file mode 100644 index 0000000000..ee3dc35818 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc @@ -0,0 +1,80 @@ +--- +title: Set up deep linking +description: Configure your app to handle direct and deferred deep links. +sidebar-position: 3 +--- + +Deep links are URIs (Uniform Resource Identifiers) that direct users to specific content within your app, enhancing user experience by guiding them directly to relevant content after they interact with a link. + +The Adjust Android Extension for the Adobe Experience SDK supports two types of deep linking, based on whether the user has already installed your app: + +- **Direct deep linking**: If the user already has your app installed, the link opens directly to the specified content. +- **Deferred deep linking**: If the user doesn’t have your app installed, the link directs them to the app store to install it. After installation, the app opens to the specified content. + +## Reattribute users with direct deep links {% #reattribute-users-with-direct-deep-links %} + +You can reattribute your users by sending deep link information to Adjust. When a user engages with a deep link, you can send the deep link data to Adjust to update their attribution information. + +To reattribute users with a direct deep link, first create an `AdjustDeeplink` instance using your deep link URI. The `AdjustDeeplink` class validates that the URI is a properly formatted string to ensure successful processing. + +The `AdjustDeeplink` class constructor requires the following argument: + +{% deflist %} +`url`: `Uri` + +: The deep link URI that opens your app. +{% /deflist %} + +After creating an `AdjustDeeplink` instance, call the `Adjust.processDeeplink` function to handle the deep link and pass the information to Adjust. The `Adjust.processDeeplink` function requires the following arguments: + +{% deflist %} +`adjustDeeplink`: `AdjustDeeplink` + +: The `AdjustDeeplink` instance you created. + +`context`: `Context` + +: The application context. +{% /deflist %} + +Here is an example of how to initialize and process a direct deep link. + +```java +Intent intent = getIntent(); +Uri data = intent.getData(); +AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); +Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); +``` + +## Deferred deep link callbacks {% #deferred-deep-link-callbacks %} + +The Adjust Android Extension for Adobe Experience SDK opens deferred deep links by default. If you want to control this behavior, or perform validation before the deep link is opened, you can configure the extension to call a function when the app is opened via a deferred deep link. To do this: + +1. Call `setOnDeferredDeeplinkResponseListener` on your `AdjustAdobeExtensionConfig` instance with the following argument: + + {% deflist %} + `onDeferredDeeplinkResponseListener`: `OnDeferredDeeplinkResponseListener` + + : A function that returns a `boolean` value. If the function returns `false`, the extension won't open the deferred deep link. + {% /deflist %} + +1. Call `AdjustAdobeExtension.setConfiguration` to set your configuration. + +Here is an example of a callback function that checks the deep link content using a function (`shouldAdjustSdkLaunchTheDeeplink`) and returns `true` or `false` depending on the outcome. + +```java +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); + +config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { + return true; + } else { + return false; + } + } +}); + +AdjustAdobeExtension.setConfiguration(config); +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/events.mdoc b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc new file mode 100644 index 0000000000..6838fbe2bd --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc @@ -0,0 +1,112 @@ +--- +title: Send event information +description: Follow this guide to send events to Adjust from your Adobe Experience app. +sidebar-position: 2 +--- + +You can use the Adjust Extension for Adobe Experience SDK to send event information to Adjust's servers in response to actions taken by your users. Adjust records these events and surfaces them in your [Datascape reports](https://help.adjust.com/en/article/datascape), [server callbacks](https://help.adjust.com/en/article/server-callbacks), and [cloud storage uploads](https://help.adjust.com/en/article/cloud-storage-uploads). + +For more information on configuring events in Adjust, see the [Add events guide](https://help.adjust.com/en/article/add-events) in the Help Center. + +## How it works {% #how-it-works %} + +Event information is sent to Adjust when the following information is passed to the `MobileCore.trackAction` API: + +1. `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT`: a string value that maps to the Adjust `trackEvent` method. +1. `contextData`: a HashMap of values used to configure your event. + +When you call `MobileCore.trackAction` with these arguments, the Adjust extension creates an event instance and passes it to the `trackEvent` method, sending the information to Adjust. + +## Reference {% #reference %} + +The `contextData` HashMap is used to hold information about an event. Each event is represented by a unique `contextData` HashMap. Configure your event instance by adding values to the `contextData` HashMap. + +### Set your event token {% #set-your-event-token %} + +When configuring your event, you MUST set your event token. This token corresponds with an event in Adjust. See [Add events](https://help.adjust.com/en/article/add-events#manage-your-events) for more information. + +To set your event token, add the following to your `contextData` HashMap: + +- Key: `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN`. +- Value: Your Adjust event token. + +```java +Map contextData = new HashMap(); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); +``` + +### Add revenue information {% #add-revenue-information %} + +To send revenue information with your event, you need to add the revenue amount and currency to your `contextData` HashMap. + +To set the event revenue, add the following data to your HashMap: + +- Key: `AdjustAdobeExtension.ADOBE_ADJUST_REVENUE`. +- Value: The amount of revenue associated with the event. This value should be a string representing a numerical value. + +To set the currency, add the following data to your HashMap: + +- Key: `AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY`. +- Value: An [ISO 4217](https://www.iban.com/currency-codes) currency code. + +```java +Map contextData = new HashMap(); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "0.25"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); +``` + +### Add callback parameters {% #add-callback-parameters %} + +Add callback parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, all callback parameters are sent to your callback URL. + +- Key: `AdjustAdobeExtension.ADOBE_ADJUST_CALLBACK_PARAM_PREFIX` plus your string parameter key. +- Value: Your parameter value. + +```java +Map contextData = new HashMap(); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CALLBACK_PARAM_PREFIX + "key1", "value1"); +``` + +### Add partner parameters {% #add-partner-parameters %} + +Add partner parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, all partner parameters are sent to any external partners you've configured. + +- Key: `AdjustAdobeExtension.ADOBE_ADJUST_PARTNER_PARAM_PREFIX` plus your string parameter key. +- Value: Your parameter value. + +```java +Map contextData = new HashMap(); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PARTNER_PARAM_PREFIX + "key1", "value1"); +``` + +## Tutorial {% #tutorial %} + +This tutorial demonstrates how to use the `MobileCore.trackAction` API to send event information to Adjust. You will learn: + +1. How to configure your Adjust event. +1. How to send event information to Adjust using the `MobileCore.trackAction` API. + +To send event information to Adjust, follow these steps: + +1. Assign `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT` to a new variable called `action`. +1. Create a HashMap to hold your Adjust event token. In the example below, the following properties are set: + - The event token is set to _{% $variables.event.token %}_. + - A callback parameter is added with the value _value1_. + - A partner parameter is added with the value _value2_. + - The event revenue is set to _0.25 EUR_. +1. Pass the action and HashMap to the `MobileCore.trackAction` method to send the information to Adjust. + +```java +String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; +Map contextData = new HashMap(); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "{% $variables.event.token %}"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key1", "value1"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key2", "value2"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "0.25"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + +MobileCore.trackAction(action, contextData); +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc b/src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc new file mode 100644 index 0000000000..8dc04c069f --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc @@ -0,0 +1,26 @@ +--- +title: Configure external device ID +description: Use external device IDs to enhance your reporting. +sidebar-position: 8 +--- + +An [external device identifier](https://help.adjust.com/en/article/external-device-identifiers) is a custom value that you can assign to a device or user. They help you recognize users across sessions and platforms. They can also help you deduplicate installs by user so that a user isn't counted as duplicate new installs. Contact your Adjust representative to get started with external device IDs. + +You external device ID must be set in your `AdjustAdobeExtensionConfig` instance before you call `AdjustAdobeExtension.setConfiguration`. You can't change this property after you've initialized the extension. + +## Reference {% #reference %} + +To set an external device ID, call the `setExternalDeviceId` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`externalDeviceId`: `String` + +: Your external device identifier. +{% /deflist %} + +```java +String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); +config.setExternalDeviceId("{YourExternalDeviceId}"); +AdjustAdobeExtension.setConfiguration(config); +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc b/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc new file mode 100644 index 0000000000..a526c7a1b6 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc @@ -0,0 +1,116 @@ +--- +title: Set up global callback and partner parameters +description: Send information to your callback URL and to network partners with each session. +sidebar-label: Set up global parameters +sidebar-position: 4 +--- + +The Adjust Android Extension for Adobe Experience SDK enables you to send additional information to Adjust to forward to your callback URL and network partners. Global parameters are string key-value pairs that you can use to communicate more information about a device or user. + +## Global callback parameters {% #global-callback-parameters %} + +If you [register a callback URL](https://help.adjust.com/en/article/recommended-placeholders-callbacks) in the Adjust dashboard, Adjust sends a GET request to your callback URL when the Adjust Android Extension for Adobe Experience SDK sends session data. You can add parameters to append to this callback request by setting global parameters in your code. + +### Reference {% #global-callback-parameters-reference %} + +Global callback parameters are managed using `Adjust` class methods. You can add and remove individual parameters, or reset all parameters at once. + +#### Add a global callback parameter + +Add a global callback parameter by calling the `Adjust.addGlobalCallbackParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The parameter key. + +`value`: `String` + +: The parameter value. +{% /deflist %} + +You can add multiple parameters by calling the `Adjust.addGlobalCallbackParameter` method multiple times. + +```java +Adjust.addGlobalCallbackParameter("gc_foo", "gc_bar"); +Adjust.addGlobalCallbackParameter("gc_key", "gc_value"); +``` + +#### Remove a global callback parameter + +You can remove a global callback parameter to stop receiving it in callbacks from Adjust. To remove a global callback parameter, call the `Adjust.removeGlobalCallbackParameter` method with the following argument: + +{% deflist %} +`key`: `String` + +: The key of the parameter you want to remove. + +{% /deflist %} + +```java +Adjust.removeGlobalCallbackParameter("gc_key"); +``` + +#### Remove all global callback parameters + +You can remove all global callback parameters at once by calling the `Adjust.removeGlobalCallbackParameters` method. This method removes all active global callback parameters, meaning you won't receive any parameters in callbacks from Adjust. + +```java +Adjust.removeGlobalCallbackParameters(); +``` + +## Global partner parameters {% #global-partner-parameters %} + +You can send extra information to your network partners by adding partner parameters. Sharing additional parameters with your external partners enables more granular analysis and facilitates retargeting. + +When the Adjust Android Extension for Adobe Experience SDK sends session data, Adjust's servers forward any global partner parameters to any partners you've configured partner parameters for. + +See [Choose data sharing options](https://help.adjust.com/en/article/data-sharing-ad-network) for more information about configuring what data you share with external partners. + +### Reference {% #global-partner-parameters-reference %} + +Global partner parameters are managed using `Adjust` class methods. You can add and remove individual parameters, or reset all parameters at once. + +#### Add a global partner parameter + +Add a global partner parameter by calling the `Adjust.addGlobalPartnerParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The parameter key. + +`value`: `String` + +: The parameter value. +{% /deflist %} + +You can add multiple parameters by calling the `Adjust.addGlobalPartnerParameter` method multiple times. + +```java +Adjust.addGlobalPartnerParameter("gc_foo", "gc_bar"); +Adjust.addGlobalPartnerParameter("gc_key", "gc_value"); +``` + +#### Remove a global partner parameter + +You can remove a global partner parameter to stop sending the parameter to network partners. To remove a global partner parameter, call the `Adjust.removeGlobalPartnerParameter` method with the following argument: + +{% deflist %} +`key`: `String` + +: The key of the parameter you want to remove. + +{% /deflist %} + +```java +Adjust.removeGlobalPartnerParameter("gc_key"); +``` + +#### Remove all global partner parameters + +You can remove all global partner parameters at once by calling the `Adjust.removeGlobalPartnerParameters` method. This method removes all active global partner parameters, meaning no parameters will be sent to network partners. + +```java +Adjust.removeGlobalPartnerParameters(); +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/index.mdoc b/src/content/docs/en/sdk/adobe-extension/android/index.mdoc new file mode 100644 index 0000000000..9fdc64ffbf --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/index.mdoc @@ -0,0 +1,36 @@ +--- +title: Android Adobe Extension integration guide +description: Follow this guide to integrate the Adjust Android Extension for Adobe Experience SDK. +category-title: Android +sidebar-position: 1 +--- + +The Adjust Android Extension for Adobe Experience SDK. + +## Integrate the extension {% #integrate-the-extension %} + +Follow the [integration guide](/en/sdk/adobe-extension/android/integration) to add the Adjust Android Extension for Adobe Experience SDK to your app. This guide covers the following: + +- [Installing dependencies](/en/sdk/adobe-extension/android/integration#install-the-adjust-extension) +- [Configuring permissions](/en/sdk/adobe-extension/android/integration#configure-permissions) +- [Integrating the Adjust Android Extension for Adobe Experience SDK](/en/sdk/adobe-extension/android/integration#integration-guide) + +## Set up features {% #set-up-features %} + +The Adjust Android Extension for Adobe Experience SDK has many features that enable you to record user activity. Use the following guides to configure each feature based on your app's needs: + +- [Send event information to Adjust](/en/sdk/adobe-extension/android/events) +- [Set up deep linking](/en/sdk/adobe-extension/android/deep-linking) +- [Set up global callback and partner parameters](/en/sdk/adobe-extension/android/global-parameters) +- [Set up a callback function to listen for attribution changes](/en/sdk/adobe-extension/android/attribution) +- [Configure push tokens for uninstall measurement](/en/sdk/adobe-extension/android/push-tokens) +- [Configure a default link token for preinstalled apps](/en/sdk/adobe-extension/android/preinstalled) +- [Configure an external device ID for reporting](/en/sdk/adobe-extension/android/external-device-id) + +## Build your app for production {% #build-your-app-for-production %} + +Once you've integrated the Adjust Android Extension for Adobe Experience and completed your testing, you can prepare your app for release. Make sure to do the following: + +- [ ] Ask your marketing team to set up all necessary campaigns in Adjust. +- [ ] Adjust your logging level according to your needs. +- [ ] Change your environment from `AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX` to `AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION` to ensure the extension sends data to the production environment. diff --git a/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc b/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc new file mode 100644 index 0000000000..2d00a0bc0b --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc @@ -0,0 +1,477 @@ +--- +title: Android Adobe Extension integration guide +description: Follow this guide to integrate the Adjust Android Extension for Adobe Experience SDK. +sidebar-position: 1 +sidebar-label: Integration guide +--- + +Welcome to the integration guide for the Adjust Extension for Adobe Experience SDK. This guide provides a step-by-step process to help you integrate and configure the Adjust extension in your Adobe Experience app for Android. Using this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information to the Adjust platform. + +This extension enables you to send data such as installs, sessions, and custom in-app events to Adjust. Follow this guide to set up, configure, and verify your integration. + +## Set up your project {% #set-up-your-project %} + +Follow these steps to set up your project to support the Adjust Extension for Adobe Experience SDK. + +### Install the Adjust Extension {% #install-the-adjust-extension %} + +To use the Adjust Extension for Adobe Experience SDK, you need to add it to your project as a dependency. The relevant packages are available on [Maven](https://maven.apache.org). + +To add the Adjust Extension for Adobe Experience SDK to your project, add the following to your `build.gradle` file: + +{% deflist %} +`com.adjust.adobeextension:adobeextension` + +: The Adjust extension for Adobe Experience. + +`com.adjust.sdk:adjust-android` + +: The Adjust Android SDK. + +`com.android.installreferrer:installreferrer` + +: The Android Install Referrer API. +{% /deflist %} + +```groovy +dependencies { + implementation 'com.adjust.adobeextension:adobeextension:{% $versions.android_adobe_extension.v3 %}' + implementation 'com.adjust.sdk:adjust-android:{% $versions.android.v5 %}' + implementation 'com.adobe.marketing.mobile:core:3.2.0' + implementation 'com.android.installreferrer:installreferrer:2.2' +} +``` + +### Add Google Play Services {% #add-google-play-services %} + +Apps that target the Google Play Store must use the `gps_adid` (Google Advertising ID) to identify devices. You need to add the `play-services-ads-identifier` AAR to your project to access the `gps_adid`. + +If you're using Maven, add the `com.google.android.gms:play-services-ads-identifier` implementation to your `build.gradle` file. + +```groovy +dependencies { + implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' +} +``` + +### Configure permissions {% #configure-permissions %} + +The Adjust Extension for Adobe Experience SDK bundles all required permissions by default. You don't need to add any permissions for the extension to work. + +If your app needs to be COPPA (Children's Online Privacy Protection Act) compliant or you don't target the Google Play Store, you MUST remove the `com.google.android.gms.permission.AD_ID` permission using a `remove` directive in your `AndroidManifest.xml` file. + +```xml + +``` + +## Integration guide {% #integration-guide %} + +Once you've completed the project setup steps, follow this guide to set up the Adjust Extension for Adobe Experience SDK. This guide shows you how to: + +1. Add the Adjust Extension to your Adobe Experience app. +1. Configure the Extension to send data to Adjust in **sandbox** mode for testing. +1. Configure your logging level to **verbose** to retrieve as much detail as possible from the extension. +1. Set up your app to send session information to Adjust. + +By the end of this guide, you will understand how to create the following integration: + +```java +import android.app.Application; +import android.util.Log; + +import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.Extension; +import com.adobe.marketing.mobile.Analytics; +import com.adobe.marketing.mobile.Identity; +import com.adobe.marketing.mobile.LoggingMode; +import com.adobe.marketing.mobile.MobileCore; + +public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } +} +``` + +### Create a global application class {% #create-a-global-application-class %} + +The recommended way to register the Adjust Android Extension for Adobe Experience SDK is to use a global Android [Application class](http://developer.android.com/reference/android/app/Application.html). If you've not yet created an Application, follow these steps: + +1. Create a new class that extends `Application` +1. Open your `AndroidManifest.xml` and find the `` element. +1. Add the name of your new class as an `android:name` attribute. In this example, the new `Application` class is named `MainApp`. + + ```xml + + + ``` + +1. Within your `Application` class, find or add the `onCreate` method. + + ```java + import android.app.Application; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + } + } + ``` + +### Configure the Adjust Extension {% #configure-the-adjust-extension %} + +Once you've created the `Application` class and called `onCreate`, follow these steps to configure the Adjust Android Extension for Adobe Experience SDK: + +1. Import the `com.adobe.marketing.mobile.MobileCore` class and call `MobileCore.setApplication(this)` to register the application context. + + ```java + import android.app.Application; + import android.util.Log; + + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + } + } + ``` + +1. Import the `com.adobe.marketing.mobile.LoggingMode` class and set your logging level by calling the `MobileCore.setLogLevel` method with the following argument: + + {% deflist %} + `logLevel`: `String` + + : The level of logging you want to enable. + + - `LoggingMode.VERBOSE`: enable all logging. + - `LoggingMode.DEBUG`: disable verbose logging. + - `LoggingMode.WARNING`: log only errors and warnings. + - `LoggingMode.ERROR`: log only errors. + {% /deflist %} + + ```java + import android.app.Application; + import android.util.Log; + + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + } + } + ``` + +1. Create a new `try...catch` block to configure the Adjust Extension: + + ```java + import android.app.Application; + import android.util.Log; + + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + } + } + ``` + +1. Within your `try` block, call `MobileCore.configureWithAppID` and pass your Adobe app ID. + + ```java + import android.app.Application; + import android.util.Log; + + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + } + } + ``` + +1. Import the following classes: + - `com.adjust.adobeextension.AdjustAdobeExtension` + - `com.adjust.adobeextension.AdjustAdobeExtensionConfig` +1. Create a new instance of `AdjustAdobeExtensionConfig` with the following argument: + + {% deflist %} + `environment`: `String` + + : The environment in which your device is running. + + - Pass `AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX` when testing. + - Pass `AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION` when running the app in production. + {% /deflist %} + + ```java + import android.app.Application; + import android.util.Log; + + import com.adjust.adobeextension.AdjustAdobeExtension; + import com.adjust.adobeextension.AdjustAdobeExtensionConfig; + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + } + } + ``` + +1. Call `AdjustAdobeExtension.setConfiguration` with your `AdjustAdobeExtensionConfig` instance as an argument to configure the Adjust SDK extension. + + ```java + import android.app.Application; + import android.util.Log; + + import com.adjust.adobeextension.AdjustAdobeExtension; + import com.adjust.adobeextension.AdjustAdobeExtensionConfig; + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + } + } + ``` + +### Register the Adjust Extension {% #register-the-adjust-extension %} + +Once you've configured the Adjust Extension, you need to register it with the Adobe Experience SDK. To do this: + +1. Create a new `try...catch` block underneath your configuration block. + + ```java + import android.app.Application; + import android.util.Log; + + import com.adjust.adobeextension.AdjustAdobeExtension; + import com.adjust.adobeextension.AdjustAdobeExtensionConfig; + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } + } + ``` + +1. Import the `com.adobe.marketing.mobile.Extension` class. +1. Within your `try` block, create a new list of extensions you want to register. In this example, we import the `Analytics` and `Identity` extensions in addition to the `AdjustAdobeExtension`. + + ```java + import android.app.Application; + import android.util.Log; + + import com.adjust.adobeextension.AdjustAdobeExtension; + import com.adjust.adobeextension.AdjustAdobeExtensionConfig; + import com.adobe.marketing.mobile.Extension; + import com.adobe.marketing.mobile.Analytics; + import com.adobe.marketing.mobile.Identity; + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } + } + ``` + +1. Import the `com.adobe.marketing.mobile.AdobeCallback` class and call the `MobileCore.registerExtensions` method with the following arguments: + + {% deflist %} + `extensions`: `List>` + + : Your list of extensions. + + `completionCallback`: `AdobeCallback` + + : A callback function that fires when registration completes. + {% /deflist %} + + ```java + import android.app.Application; + import android.util.Log; + + import com.adjust.adobeextension.AdjustAdobeExtension; + import com.adjust.adobeextension.AdjustAdobeExtensionConfig; + import com.adobe.marketing.mobile.Extension; + import com.adobe.marketing.mobile.Analytics; + import com.adobe.marketing.mobile.Identity; + import com.adobe.marketing.mobile.LoggingMode; + import com.adobe.marketing.mobile.MobileCore; + + public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } + } + ``` + +Once you've completed these steps, build and run your app. In your `LogCat` viewer, set the filter `tag:Adjust` to show only logs relating to the Adjust Extension. After you launch your app, you should see the following message: `Install tracked`. diff --git a/src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc b/src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc new file mode 100644 index 0000000000..1c7cb08094 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc @@ -0,0 +1,35 @@ +--- +title: Send preinstalled app activity +sidebar-label: Configure preinstalled app +description: Configure a campaign to send information from preinstalled apps. +sidebar-position: 7 +--- + +You can use the Adjust Android Extension for Adobe Experience SDK to send activity to Adjust from apps that came preinstalled on a user's device. This enables you to send information from users who didn't download your app from a campaign. + +You can send data from preinstalled apps to a predefined default link. When a user opens the app for the first time, the install session is associated with the default link token. + +## Reference {% #reference %} + +To set your default link token, call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`token`: `String` + +: Your alphanumeric Adjust link token. +{% /deflist %} + +## Tutorial {% #tutorial %} + +This tutorial demonstrates how to define a default link token for preinstalled apps. + +1. [Create a new campaign link in Campaign Lab](https://help.adjust.com/en/article/links) and copy the link token. +1. Call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with your link token. +1. Initialize the Adjust Android Extension for Adobe Experience SDK to set the configuration. + +```java +String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); +config.setDefaultTracker("{Token}"); +AdjustAdobeExtension.setConfiguration(config); +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc b/src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc new file mode 100644 index 0000000000..5cafc18a2c --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc @@ -0,0 +1,41 @@ +--- +title: Configure push tokens +description: Configure push tokens for audiences and uninstall and reinstall measurement. +sidebar-position: 6 +--- + +Push notifications enable you to deliver personalized content to your users. You can use deep links in push notifications to direct users to specific locations in your app and measure reattributions. + +Each device generates a push token that is unique to the device. This is the token that is used to target the device with push notifications. To communicate a device's push token with Adjust, you can add it to your `AdjustAdobeExtensionConfig` instance. + +The push token is a unique identifier that can be used to sort [Audiences](https://help.adjust.com/en/article/audiences) and client callbacks. Push tokens are also required for [Uninstall and reinstall measurement](https://help.adjust.com/en/article/uninstalls-reinstalls). + +## Tutorial {% #tutorial %} + +To send your push token to Adjust, you need to call the `MobileCore.trackAction` API once you've obtained your token. To do this: + +1. Assign the `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN` constant to a variable. +1. Create a new HashMap to hold your `contextData`. +1. Add the following values to your `contextData` HashMap: + - Key: `AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN` + - Value: your push token +1. Call the `MobileCore.trackAction` method and pass the following arguments: + {% deflist %} + `action`: `String` + + : Pass the variable mapped to the `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN` constant. + + `contextData`: `Map` + + : Pass your HashMap. + {% /deflist %} + +In the example below, the push token is set to "your_push_token". + +```java +String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; +Map contextData= new HashMap(); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "your_push_token"); + +MobileCore.trackAction(action, contextData); +``` diff --git a/src/content/docs/en/sdk/adobe-extension/index.mdoc b/src/content/docs/en/sdk/adobe-extension/index.mdoc new file mode 100644 index 0000000000..b4ec09e268 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/index.mdoc @@ -0,0 +1,7 @@ +--- +title: Adjust Extension for Adobe Experience SDK +description: Use the Adjust Extension for Adobe Experience SDK to access Adjust's features in your Adobe Experience apps +sidebar-label: Adobe Experience Extension +sidebar-position: 12 +type: category +--- diff --git a/src/content/docs/en/sdk/migration/index.mdx b/src/content/docs/en/sdk/migration/index.mdx index 2418959274..6dfb875d06 100644 --- a/src/content/docs/en/sdk/migration/index.mdx +++ b/src/content/docs/en/sdk/migration/index.mdx @@ -2,6 +2,6 @@ title: Migration guides description: Follow these guides to migrate between SDK versions slug: en/sdk/migration -sidebar-position: 12 +sidebar-position: 13 type: category --- From e79429b791c7544717c6c4862d9eed9cfd9007bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Thu, 31 Oct 2024 16:06:17 +0100 Subject: [PATCH 03/22] Update fetch script --- src/declarations.d.ts | 15 +++- src/integrations/fetchSdkVersions.ts | 111 +++++++++++++-------------- 2 files changed, 65 insertions(+), 61 deletions(-) diff --git a/src/declarations.d.ts b/src/declarations.d.ts index 6661008f29..55adac3ce9 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -32,12 +32,19 @@ declare interface VersionProps { version: string; } -declare interface VersionMap { - [key: string]: string | { - [key: string]: string; - }; +interface VersionTag { + [versionKey: string]: string; } +interface PlatformVersion { + versions: VersionTag | string; + useSdkSuffix: boolean; +} + +type VersionMap = { + [platform: string]: PlatformVersion; +}; + declare type BadgeColor = | "neutral" | "negative" diff --git a/src/integrations/fetchSdkVersions.ts b/src/integrations/fetchSdkVersions.ts index cc00f5698f..976e9190e5 100644 --- a/src/integrations/fetchSdkVersions.ts +++ b/src/integrations/fetchSdkVersions.ts @@ -21,19 +21,19 @@ type GraphQLResponse = { }; let versionReplacements: VersionMap = { - android: { v4: "x.x.x", v5: "x.x.x" }, - ios: { v4: "x.x.x", v5: "x.x.x" }, - unity: { v4: "x.x.x", v5: "x.x.x" }, - react_native: { v4: "x.x.x", v5: "x.x.x" }, - cordova: { v4: "x.x.x", v5: "x.x.x" }, - flutter: { v4: "x.x.x", v5: "x.x.x" }, - cocos2dx: { v4: "x.x.x", v5: "x.x.x" }, + android: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, + ios: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, + unity: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, + react_native: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, + cordova: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, + flutter: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, + cocos2dx: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, android_adobe_extension: { - v2: "x.x.x", - v3: "x.x.x", + versions: { v2: "x.x.x", v3: "x.x.x" }, + useSdkSuffix: false, }, - web: "x.x.x", - windows: "x.x.x", + web: { versions: "x.x.x", useSdkSuffix: true }, + windows: { versions: "x.x.x", useSdkSuffix: true }, }; /** @@ -45,72 +45,69 @@ export async function fetchVersions() { if (import.meta.env.PROD) { const fetchPromises = Object.keys(versionReplacements).map( async (platform) => { - const currentPlatform = versionReplacements[platform]; + const { versions, useSdkSuffix } = versionReplacements[platform]; + const repoName = `${platform}${useSdkSuffix ? "_sdk" : ""}`; - if (typeof currentPlatform === "object") { - // Dynamically build query segments for each version (e.g., v2, v3, v4, v5) - const versionQueries = Object.keys(currentPlatform) + if (typeof versions === "object") { + const versionQueries = Object.keys(versions) .map( (versionKey) => ` - ${versionKey}Tags: repository(owner: "adjust", name: "${platform}_sdk") { - refs( - refPrefix: "refs/tags/" - orderBy: { field: TAG_COMMIT_DATE, direction: DESC } - first: 1 - query: "${versionKey}" - ) { - edges { - node { - name - } - } - } - } - `, + ${versionKey}Tags: repository(owner: "adjust", name: "${repoName}") { + refs( + refPrefix: "refs/tags/" + orderBy: { field: TAG_COMMIT_DATE, direction: DESC } + first: 1 + query: "${versionKey}" + ) { + edges { + node { + name + } + } + } + } + `, ) .join("\n"); - // Build the full query with all versions for this platform const query = ` - query RepositoryTags { - ${versionQueries} - } - `; + query RepositoryTags { + ${versionQueries} + } + `; const response = await octokit.graphql(query); - // Extract and store each version's tag name from the response - Object.keys(currentPlatform).forEach((versionKey) => { + Object.keys(versions).forEach((versionKey) => { const tag = response[`${versionKey}Tags`]?.refs.edges[0]?.node.name.replace( "v", "", ) || "Not found"; - currentPlatform[versionKey] = tag; + versions[versionKey] = tag; }); } else { - // For non-object platforms, fetch only the latest tag const query = ` - query RepositoryTags { - latestTag: repository(owner: "adjust", name: "${platform}_sdk") { - refs( - refPrefix: "refs/tags/" - orderBy: { field: TAG_COMMIT_DATE, direction: DESC } - first: 1 - query: "v" - ) { - edges { - node { - name - } - } - } - } - } - `; + query RepositoryTags { + latestTag: repository(owner: "adjust", name: "${repoName}") { + refs( + refPrefix: "refs/tags/" + orderBy: { field: TAG_COMMIT_DATE, direction: DESC } + first: 1 + query: "v" + ) { + edges { + node { + name + } + } + } + } + } + `; const response = await octokit.graphql(query); - versionReplacements[platform] = + versionReplacements[platform].versions = response.latestTag?.refs.edges[0]?.node.name.replace("v", "") || "Not found"; } From 22343ac8230b578ce8097152384cbcfaa5daa1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Thu, 31 Oct 2024 16:20:03 +0100 Subject: [PATCH 04/22] Update preamble --- src/content/docs/en/sdk/adobe-extension/android/index.mdoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/sdk/adobe-extension/android/index.mdoc b/src/content/docs/en/sdk/adobe-extension/android/index.mdoc index 9fdc64ffbf..6be12d8845 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/index.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/index.mdoc @@ -5,7 +5,9 @@ category-title: Android sidebar-position: 1 --- -The Adjust Android Extension for Adobe Experience SDK. +The Adjust Android Extension for Adobe Experience SDK provides you with a powerful tool to enhance your app's performance analytics. By integrating this extension, you can send essential data such as install, session, and in-app event information to Adjust. + +The Adjust Android Extension for Adobe Experience SDK is designed to work within the Adobe Experience SDK framework, ensuring that you can easily implement it without disrupting your existing workflows. ## Integrate the extension {% #integrate-the-extension %} From fd10d92107ea7f2b1f3e44267eee4f3fa6d859f7 Mon Sep 17 00:00:00 2001 From: Ronny Shani <63248335+ironnysh@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:09:19 +0100 Subject: [PATCH 05/22] Proofreading --- .../adobe-extension/android/attribution.mdoc | 15 +++--- .../adobe-extension/android/deep-linking.mdoc | 29 ++++++---- .../sdk/adobe-extension/android/events.mdoc | 53 ++++++++++--------- .../android/external-device-id.mdoc | 8 ++- .../android/global-parameters.mdoc | 40 +++++++------- .../en/sdk/adobe-extension/android/index.mdoc | 16 +++--- .../adobe-extension/android/integration.mdoc | 52 +++++++++--------- .../adobe-extension/android/preinstalled.mdoc | 10 ++-- .../adobe-extension/android/push-tokens.mdoc | 34 +++++------- .../adobe-extension/android/index.mdoc | 24 ++++++--- 10 files changed, 152 insertions(+), 129 deletions(-) diff --git a/src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc b/src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc index 135ed03f30..cbab1e38b7 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/attribution.mdoc @@ -31,20 +31,17 @@ config.setOnAttributionChangedListener(new OnAttributionChangedListener() { AdjustAdobeExtension.setConfiguration(config); ``` -## Tutorial {% #tutorial %} +## Example: An attribution callback function {% #example-attribution-callback-function %} -This tutorial demonstrates how to configure a callback function to do the following: - -1. Log that the attribution information has changed. -1. Log the attribution information as a single string. +This code sample demonstrates how to configure a callback function that logs an update in attribution information. To set up this function, follow these steps: 1. Create a new `AdjustAdobeExtensionConfig` instance. -1. Call the `setOnAttributionChangedListener` with an `OnAttributionChangedListener` instance as an argument. -1. Within the `OnAttributionChangedListener` declaration, create a new `void` function with an `AdjustAttribution` parameter. -1. Within your `void` function, log out the attribution by casting it as a `String`. -1. Call `AdjustAdobeExtension.setConfiguration` with your `AdjustAdobeExtensionConfig` instance as an argument to initialize the extension. +2. Call the `setOnAttributionChangedListener` with an `OnAttributionChangedListener` instance as an argument. +3. Create a new `void` function with an `AdjustAttribution` parameter. +4. Log out the attribution by casting it as a `String`. +5. Initialize the extension: Call `AdjustAdobeExtension.setConfiguration` with your `AdjustAdobeExtensionConfig` instance as an argument. ```java AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); diff --git a/src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc b/src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc index ee3dc35818..0cc1fe944d 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/deep-linking.mdoc @@ -4,18 +4,20 @@ description: Configure your app to handle direct and deferred deep links. sidebar-position: 3 --- -Deep links are URIs (Uniform Resource Identifiers) that direct users to specific content within your app, enhancing user experience by guiding them directly to relevant content after they interact with a link. +Deep links are URIs (Uniform Resource Identifiers) that direct users to specific pages within your app. They enhance user experience by guiding them directly to relevant content after they interact with a link. The Adjust Android Extension for the Adobe Experience SDK supports two types of deep linking, based on whether the user has already installed your app: -- **Direct deep linking**: If the user already has your app installed, the link opens directly to the specified content. -- **Deferred deep linking**: If the user doesn’t have your app installed, the link directs them to the app store to install it. After installation, the app opens to the specified content. +- **Direct deep links**: If the user already has your app installed, the link opens the specified page. +- **Deferred deep links**: If the user doesn’t have your app installed, the link directs them to the app store to install it. After installation, the app opens the specified page. ## Reattribute users with direct deep links {% #reattribute-users-with-direct-deep-links %} -You can reattribute your users by sending deep link information to Adjust. When a user engages with a deep link, you can send the deep link data to Adjust to update their attribution information. +You can reattribute your users by sending deep link information to Adjust. When a user engages with a deep link, you can send this data to Adjust to update their attribution information. -To reattribute users with a direct deep link, first create an `AdjustDeeplink` instance using your deep link URI. The `AdjustDeeplink` class validates that the URI is a properly formatted string to ensure successful processing. +1. First, create an `AdjustDeeplink` instance with your deep link URI. The `AdjustDeeplink` class validates this URI and checks the formatted string to ensure successful processing. + +2. Then, call the `Adjust.processDeeplink` function to handle the deep link and pass the information to Adjust. The `AdjustDeeplink` class constructor requires the following argument: @@ -25,7 +27,7 @@ The `AdjustDeeplink` class constructor requires the following argument: : The deep link URI that opens your app. {% /deflist %} -After creating an `AdjustDeeplink` instance, call the `Adjust.processDeeplink` function to handle the deep link and pass the information to Adjust. The `Adjust.processDeeplink` function requires the following arguments: +The `Adjust.processDeeplink` function requires the following arguments: {% deflist %} `adjustDeeplink`: `AdjustDeeplink` @@ -37,6 +39,8 @@ After creating an `AdjustDeeplink` instance, call the `Adjust.processDeeplink` f : The application context. {% /deflist %} +### Example: Initialize a direct deep link {% #example-initialize-direct-deep-link %} + Here is an example of how to initialize and process a direct deep link. ```java @@ -48,19 +52,22 @@ Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); ## Deferred deep link callbacks {% #deferred-deep-link-callbacks %} -The Adjust Android Extension for Adobe Experience SDK opens deferred deep links by default. If you want to control this behavior, or perform validation before the deep link is opened, you can configure the extension to call a function when the app is opened via a deferred deep link. To do this: +The Adjust Android Extension for Adobe Experience SDK opens deferred deep links by default. To control this behavior, or perform validation before the deep link is opened, configure the extension to call a function when the app opens via a deferred deep link. + +1. Call `setOnDeferredDeeplinkResponseListener` on your `AdjustAdobeExtensionConfig` instance. +2. Call `AdjustAdobeExtension.setConfiguration` to set your configuration. -1. Call `setOnDeferredDeeplinkResponseListener` on your `AdjustAdobeExtensionConfig` instance with the following argument: +The `OnDeferredDeeplinkResponseListener` function requires the following argument: {% deflist %} `onDeferredDeeplinkResponseListener`: `OnDeferredDeeplinkResponseListener` - : A function that returns a `boolean` value. If the function returns `false`, the extension won't open the deferred deep link. + : A function that returns a `boolean` value. If it returns `false`, the extension won't open the deferred deep link. {% /deflist %} -1. Call `AdjustAdobeExtension.setConfiguration` to set your configuration. +### Example: Create a deferred deep link function {% #example-deferred-deep-link-function %} -Here is an example of a callback function that checks the deep link content using a function (`shouldAdjustSdkLaunchTheDeeplink`) and returns `true` or `false` depending on the outcome. +Here is an example of a callback function that checks the deep link content using a function (`shouldAdjustSdkLaunchTheDeeplink`), and returns `true` or `false` depending on the outcome. ```java AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); diff --git a/src/content/docs/en/sdk/adobe-extension/android/events.mdoc b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc index 6838fbe2bd..e7b1e81a9d 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/events.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc @@ -4,26 +4,28 @@ description: Follow this guide to send events to Adjust from your Adobe Experien sidebar-position: 2 --- -You can use the Adjust Extension for Adobe Experience SDK to send event information to Adjust's servers in response to actions taken by your users. Adjust records these events and surfaces them in your [Datascape reports](https://help.adjust.com/en/article/datascape), [server callbacks](https://help.adjust.com/en/article/server-callbacks), and [cloud storage uploads](https://help.adjust.com/en/article/cloud-storage-uploads). +You can use the Adjust Extension for Adobe Experience SDK to send event information to Adjust's servers when your users take specific actions. Adjust records these events and surfaces them in your [Datascape reports](https://help.adjust.com/en/article/datascape), [server callbacks](https://help.adjust.com/en/article/server-callbacks), and [cloud storage uploads](https://help.adjust.com/en/article/cloud-storage-uploads). -For more information on configuring events in Adjust, see the [Add events guide](https://help.adjust.com/en/article/add-events) in the Help Center. +For more information on configuring events in Adjust, visit the [Add events guide](https://help.adjust.com/en/article/add-events) in the Help Center. ## How it works {% #how-it-works %} Event information is sent to Adjust when the following information is passed to the `MobileCore.trackAction` API: 1. `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT`: a string value that maps to the Adjust `trackEvent` method. -1. `contextData`: a HashMap of values used to configure your event. +2. `contextData`: a HashMap of values used to configure your event. -When you call `MobileCore.trackAction` with these arguments, the Adjust extension creates an event instance and passes it to the `trackEvent` method, sending the information to Adjust. +When you call `MobileCore.trackAction` with these arguments, the Adjust extension creates an event instance, passes it to the `trackEvent` method, and sends the information to Adjust. ## Reference {% #reference %} -The `contextData` HashMap is used to hold information about an event. Each event is represented by a unique `contextData` HashMap. Configure your event instance by adding values to the `contextData` HashMap. +The `contextData` HashMap holds information about an event. Each event is represented by a unique `contextData` HashMap. To configure your event instance, add values to HashMap. -### Set your event token {% #set-your-event-token %} +## Configure and send information {% #configure-send-information %} + +When you configure your event, you MUST set your event token. This token corresponds with an event in Adjust. See [Add events](https://help.adjust.com/en/article/add-events#manage-your-events) for more information. -When configuring your event, you MUST set your event token. This token corresponds with an event in Adjust. See [Add events](https://help.adjust.com/en/article/add-events#manage-your-events) for more information. +### Set your event token {% #set-your-event-token %} To set your event token, add the following to your `contextData` HashMap: @@ -37,12 +39,12 @@ contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); ### Add revenue information {% #add-revenue-information %} -To send revenue information with your event, you need to add the revenue amount and currency to your `contextData` HashMap. +To send revenue information with your event, add the revenue amount and currency to your `contextData` HashMap. To set the event revenue, add the following data to your HashMap: - Key: `AdjustAdobeExtension.ADOBE_ADJUST_REVENUE`. -- Value: The amount of revenue associated with the event. This value should be a string representing a numerical value. +- Value: The amount of revenue associated with the event. This value should be a string that represents a numerical value. To set the currency, add the following data to your HashMap: @@ -58,7 +60,7 @@ contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); ### Add callback parameters {% #add-callback-parameters %} -Add callback parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, all callback parameters are sent to your callback URL. +Add callback parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, it sends all callback parameters to your callback URL. - Key: `AdjustAdobeExtension.ADOBE_ADJUST_CALLBACK_PARAM_PREFIX` plus your string parameter key. - Value: Your parameter value. @@ -71,7 +73,7 @@ contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CALLBACK_PARAM_PREFIX + "key1" ### Add partner parameters {% #add-partner-parameters %} -Add partner parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, all partner parameters are sent to any external partners you've configured. +Add partner parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, it sends all partner parameters to any external partners you've configured. - Key: `AdjustAdobeExtension.ADOBE_ADJUST_PARTNER_PARAM_PREFIX` plus your string parameter key. - Value: Your parameter value. @@ -82,29 +84,28 @@ contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PARTNER_PARAM_PREFIX + "key1", "value1"); ``` -## Tutorial {% #tutorial %} -This tutorial demonstrates how to use the `MobileCore.trackAction` API to send event information to Adjust. You will learn: +## Example: Send event information {% #example-send-event-information %} -1. How to configure your Adjust event. -1. How to send event information to Adjust using the `MobileCore.trackAction` API. +This code sample demonstrates how to use the `MobileCore.trackAction` API to send event information to Adjust. -To send event information to Adjust, follow these steps: +To configure your event, follow these steps: -1. Assign `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT` to a new variable called `action`. -1. Create a HashMap to hold your Adjust event token. In the example below, the following properties are set: - - The event token is set to _{% $variables.event.token %}_. - - A callback parameter is added with the value _value1_. - - A partner parameter is added with the value _value2_. - - The event revenue is set to _0.25 EUR_. -1. Pass the action and HashMap to the `MobileCore.trackAction` method to send the information to Adjust. +1. Create a new variable called `action`. +2. Assign `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT` to the variable you created. +3. Create a HashMap to hold your Adjust event token. The example below sets the following properties: + - The event token is _abc123_. + - A callback parameter with the value _callback_value_. + - A partner parameter with the value _partner_value_. + - The event revenue is _0.25 EUR_. +4. Send the information to Adjust: Pass the `action` variable and HashMap to the `MobileCore.trackAction` method. ```java String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; Map contextData = new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "{% $variables.event.token %}"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key1", "value1"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key2", "value2"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key1", "callback_value"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key2", "partner_value"); contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "0.25"); contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); diff --git a/src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc b/src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc index 8dc04c069f..c852c44296 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/external-device-id.mdoc @@ -4,9 +4,13 @@ description: Use external device IDs to enhance your reporting. sidebar-position: 8 --- -An [external device identifier](https://help.adjust.com/en/article/external-device-identifiers) is a custom value that you can assign to a device or user. They help you recognize users across sessions and platforms. They can also help you deduplicate installs by user so that a user isn't counted as duplicate new installs. Contact your Adjust representative to get started with external device IDs. +An [external device identifier](https://help.adjust.com/en/article/external-device-identifiers) is a custom value that you can assign to a device or user. This helps you recognize users across sessions and platforms. External device IDs also help you deduplicate installs by user, to avoid counting multiple new installs assoiciated with the same user. -You external device ID must be set in your `AdjustAdobeExtensionConfig` instance before you call `AdjustAdobeExtension.setConfiguration`. You can't change this property after you've initialized the extension. +{% callout type="important" %} +Contact your Adjust representative to get started with external device IDs. +{% /callout %} + +You must set your external device ID in your `AdjustAdobeExtensionConfig` instance before you call `AdjustAdobeExtension.setConfiguration`. You can't change this property after you've initialized the extension. ## Reference {% #reference %} diff --git a/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc b/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc index a526c7a1b6..e65d83b7a7 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc @@ -9,15 +9,15 @@ The Adjust Android Extension for Adobe Experience SDK enables you to send additi ## Global callback parameters {% #global-callback-parameters %} -If you [register a callback URL](https://help.adjust.com/en/article/recommended-placeholders-callbacks) in the Adjust dashboard, Adjust sends a GET request to your callback URL when the Adjust Android Extension for Adobe Experience SDK sends session data. You can add parameters to append to this callback request by setting global parameters in your code. +If you [register a callback URL](https://help.adjust.com/en/article/recommended-placeholders-callbacks) in the Adjust dashboard, Adjust sends a `GET` request to your callback URL when the SDK sends session data. To append parameters to this callback request, set the global parameters in your code. -### Reference {% #global-callback-parameters-reference %} +#### Reference {% #global-callback-parameters-reference %} -Global callback parameters are managed using `Adjust` class methods. You can add and remove individual parameters, or reset all parameters at once. +The `Adjust` class methods manage the global callback parameters. You can add and remove individual parameters, or reset all parameters at once. -#### Add a global callback parameter +### Add a global callback parameter {% #add-global-callback-parameter %} -Add a global callback parameter by calling the `Adjust.addGlobalCallbackParameter` method with the following arguments: +To add a global callback parameter, call the `Adjust.addGlobalCallbackParameter` method with the following arguments: {% deflist %} `key`: `String` @@ -36,9 +36,9 @@ Adjust.addGlobalCallbackParameter("gc_foo", "gc_bar"); Adjust.addGlobalCallbackParameter("gc_key", "gc_value"); ``` -#### Remove a global callback parameter +### Remove a global callback parameter {% #remove-global-callback-parameter %} -You can remove a global callback parameter to stop receiving it in callbacks from Adjust. To remove a global callback parameter, call the `Adjust.removeGlobalCallbackParameter` method with the following argument: +To remove a global callback parameter, call the `Adjust.removeGlobalCallbackParameter` method with the following argument: {% deflist %} `key`: `String` @@ -51,9 +51,11 @@ You can remove a global callback parameter to stop receiving it in callbacks fro Adjust.removeGlobalCallbackParameter("gc_key"); ``` -#### Remove all global callback parameters +### Remove all global callback parameters {% #remove-all-global-callback-parameter %} -You can remove all global callback parameters at once by calling the `Adjust.removeGlobalCallbackParameters` method. This method removes all active global callback parameters, meaning you won't receive any parameters in callbacks from Adjust. +To remove all global callback parameters at once, call the `Adjust.removeGlobalCallbackParameters` method. + +This method removes all active global callback parameters, meaning you won't receive any parameters in callbacks from Adjust. ```java Adjust.removeGlobalCallbackParameters(); @@ -63,17 +65,17 @@ Adjust.removeGlobalCallbackParameters(); You can send extra information to your network partners by adding partner parameters. Sharing additional parameters with your external partners enables more granular analysis and facilitates retargeting. -When the Adjust Android Extension for Adobe Experience SDK sends session data, Adjust's servers forward any global partner parameters to any partners you've configured partner parameters for. +When the Adjust Android Extension for Adobe Experience SDK sends session data, Adjust's servers forward any global partner parameters to any partners you've configured. See [Choose data sharing options](https://help.adjust.com/en/article/data-sharing-ad-network) for more information about configuring what data you share with external partners. -### Reference {% #global-partner-parameters-reference %} +#### Reference {% #global-partner-parameters-reference %} -Global partner parameters are managed using `Adjust` class methods. You can add and remove individual parameters, or reset all parameters at once. +The `Adjust` class methods manage the global partner parameters. You can add and remove individual parameters, or reset all parameters at once. -#### Add a global partner parameter +### Add a global partner parameter {% #add-global-partner-parameter %} -Add a global partner parameter by calling the `Adjust.addGlobalPartnerParameter` method with the following arguments: +To add a global partner parameter, call the `Adjust.addGlobalPartnerParameter` method with the following arguments: {% deflist %} `key`: `String` @@ -92,9 +94,9 @@ Adjust.addGlobalPartnerParameter("gc_foo", "gc_bar"); Adjust.addGlobalPartnerParameter("gc_key", "gc_value"); ``` -#### Remove a global partner parameter +### Remove a global partner parameter {% #remove-global-partner-parameter %} -You can remove a global partner parameter to stop sending the parameter to network partners. To remove a global partner parameter, call the `Adjust.removeGlobalPartnerParameter` method with the following argument: +To remove a global partner parameter, call the `Adjust.removeGlobalPartnerParameter` method with the following argument: {% deflist %} `key`: `String` @@ -107,9 +109,11 @@ You can remove a global partner parameter to stop sending the parameter to netwo Adjust.removeGlobalPartnerParameter("gc_key"); ``` -#### Remove all global partner parameters +### Remove all global partner parameters {% #remove-all-global-partner-parameter %} + +To remove all global partner parameters at once, call the `Adjust.removeGlobalPartnerParameters` method. -You can remove all global partner parameters at once by calling the `Adjust.removeGlobalPartnerParameters` method. This method removes all active global partner parameters, meaning no parameters will be sent to network partners. +This method removes all active global partner parameters, meaning no parameters will be sent to network partners. ```java Adjust.removeGlobalPartnerParameters(); diff --git a/src/content/docs/en/sdk/adobe-extension/android/index.mdoc b/src/content/docs/en/sdk/adobe-extension/android/index.mdoc index 6be12d8845..a391670da2 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/index.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/index.mdoc @@ -5,17 +5,17 @@ category-title: Android sidebar-position: 1 --- -The Adjust Android Extension for Adobe Experience SDK provides you with a powerful tool to enhance your app's performance analytics. By integrating this extension, you can send essential data such as install, session, and in-app event information to Adjust. +The Adjust Android Extension for Adobe Experience SDK provides you with a powerful tool to enhance your app's performance analytics. By integrating this extension, you can send essential data—such as install, session, and in-app event information—to Adjust. -The Adjust Android Extension for Adobe Experience SDK is designed to work within the Adobe Experience SDK framework, ensuring that you can easily implement it without disrupting your existing workflows. +The [Adjust Android Extension for Adobe Experience SDK](https://github.com/adjust/android_adobe_extension) is designed to work within the Adobe Experience SDK framework, so you can implement it without disrupting your existing workflows. ## Integrate the extension {% #integrate-the-extension %} Follow the [integration guide](/en/sdk/adobe-extension/android/integration) to add the Adjust Android Extension for Adobe Experience SDK to your app. This guide covers the following: -- [Installing dependencies](/en/sdk/adobe-extension/android/integration#install-the-adjust-extension) -- [Configuring permissions](/en/sdk/adobe-extension/android/integration#configure-permissions) -- [Integrating the Adjust Android Extension for Adobe Experience SDK](/en/sdk/adobe-extension/android/integration#integration-guide) +- [Install dependencies](/en/sdk/adobe-extension/android/integration#install-the-adjust-extension) +- [Configure permissions](/en/sdk/adobe-extension/android/integration#configure-permissions) +- [Integrate the Adjust Android Extension for Adobe Experience SDK](/en/sdk/adobe-extension/android/integration#integration-guide) ## Set up features {% #set-up-features %} @@ -31,8 +31,8 @@ The Adjust Android Extension for Adobe Experience SDK has many features that ena ## Build your app for production {% #build-your-app-for-production %} -Once you've integrated the Adjust Android Extension for Adobe Experience and completed your testing, you can prepare your app for release. Make sure to do the following: +After you've integrated the Adjust Android Extension for Adobe Experience and completed [your testing](/en/sdk/testing), prepare your app for release. Make sure to do the following: - [ ] Ask your marketing team to set up all necessary campaigns in Adjust. -- [ ] Adjust your logging level according to your needs. -- [ ] Change your environment from `AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX` to `AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION` to ensure the extension sends data to the production environment. +- [ ] Set your [logging level](/en/sdk/adobe-extension/android/integration#integration-guide) according to your needs. +- [ ] Change [your environment](/en/sdk/adobe-extension/android/integration#configure-the-adjust-extension) to `AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION` to allow the extension to send data in your production environment. diff --git a/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc b/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc index 2d00a0bc0b..9a20d3901a 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc @@ -5,9 +5,9 @@ sidebar-position: 1 sidebar-label: Integration guide --- -Welcome to the integration guide for the Adjust Extension for Adobe Experience SDK. This guide provides a step-by-step process to help you integrate and configure the Adjust extension in your Adobe Experience app for Android. Using this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information to the Adjust platform. +This is a step-by-step guide to help you integrate and configure the Adjust extension in your Adobe Experience app for Android. With this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information. -This extension enables you to send data such as installs, sessions, and custom in-app events to Adjust. Follow this guide to set up, configure, and verify your integration. +This extension enables you to send installs, sessions, custom in-app events, and other types of data to Adjust. Follow this guide to set up, configure, and verify your integration. ## Set up your project {% #set-up-your-project %} @@ -17,7 +17,7 @@ Follow these steps to set up your project to support the Adjust Extension for Ad To use the Adjust Extension for Adobe Experience SDK, you need to add it to your project as a dependency. The relevant packages are available on [Maven](https://maven.apache.org). -To add the Adjust Extension for Adobe Experience SDK to your project, add the following to your `build.gradle` file: +Add the following to your `build.gradle` file: {% deflist %} `com.adjust.adobeextension:adobeextension` @@ -44,7 +44,7 @@ dependencies { ### Add Google Play Services {% #add-google-play-services %} -Apps that target the Google Play Store must use the `gps_adid` (Google Advertising ID) to identify devices. You need to add the `play-services-ads-identifier` AAR to your project to access the `gps_adid`. +Apps that target the Google Play Store must use the `gps_adid` (Google Advertising ID) to identify devices. To access the `gps_adid`, add the `play-services-ads-identifier` AAR to your project. If you're using Maven, add the `com.google.android.gms:play-services-ads-identifier` implementation to your `build.gradle` file. @@ -66,14 +66,14 @@ If your app needs to be COPPA (Children's Online Privacy Protection Act) complia ## Integration guide {% #integration-guide %} -Once you've completed the project setup steps, follow this guide to set up the Adjust Extension for Adobe Experience SDK. This guide shows you how to: +Once you've completed the project setup steps, continue to integrate the Adjust Extension for Adobe Experience SDK. The following guide shows you how to: 1. Add the Adjust Extension to your Adobe Experience app. -1. Configure the Extension to send data to Adjust in **sandbox** mode for testing. -1. Configure your logging level to **verbose** to retrieve as much detail as possible from the extension. -1. Set up your app to send session information to Adjust. +2. Set your logging level to **verbose** to retrieve as much detail as possible from the extension. +3. Test the Extension in **sandbox** mode to ensure it sends data to Adjust. +4. Register with the Adobe Experience SDK. -By the end of this guide, you will understand how to create the following integration: +Below is the sample integration that you'll learn to build: ```java import android.app.Application; @@ -128,15 +128,15 @@ public class MainApp extends Application { The recommended way to register the Adjust Android Extension for Adobe Experience SDK is to use a global Android [Application class](http://developer.android.com/reference/android/app/Application.html). If you've not yet created an Application, follow these steps: 1. Create a new class that extends `Application` -1. Open your `AndroidManifest.xml` and find the `` element. -1. Add the name of your new class as an `android:name` attribute. In this example, the new `Application` class is named `MainApp`. +2. Open your `AndroidManifest.xml` and find the `` element. +3. Add the name of your new class as an `android:name` attribute. In this example, the new `Application` class is named `MainApp`. ```xml ``` -1. Within your `Application` class, find or add the `onCreate` method. +4. Within your `Application` class, find or add the `onCreate` method. ```java import android.app.Application; @@ -153,7 +153,7 @@ The recommended way to register the Adjust Android Extension for Adobe Experienc Once you've created the `Application` class and called `onCreate`, follow these steps to configure the Adjust Android Extension for Adobe Experience SDK: -1. Import the `com.adobe.marketing.mobile.MobileCore` class and call `MobileCore.setApplication(this)` to register the application context. +1. Import the `com.adobe.marketing.mobile.MobileCore` class, and call `MobileCore.setApplication(this)` to register the application context. ```java import android.app.Application; @@ -171,7 +171,7 @@ Once you've created the `Application` class and called `onCreate`, follow these } ``` -1. Import the `com.adobe.marketing.mobile.LoggingMode` class and set your logging level by calling the `MobileCore.setLogLevel` method with the following argument: +2. Import the `com.adobe.marketing.mobile.LoggingMode` class, and set your logging level by calling the `MobileCore.setLogLevel` method with the following argument: {% deflist %} `logLevel`: `String` @@ -202,7 +202,7 @@ Once you've created the `Application` class and called `onCreate`, follow these } ``` -1. Create a new `try...catch` block to configure the Adjust Extension: +3. Create a new `try...catch` block to configure the Adjust Extension: ```java import android.app.Application; @@ -227,7 +227,7 @@ Once you've created the `Application` class and called `onCreate`, follow these } ``` -1. Within your `try` block, call `MobileCore.configureWithAppID` and pass your Adobe app ID. +4. Within your `try` block, call `MobileCore.configureWithAppID` and pass your Adobe app ID. ```java import android.app.Application; @@ -253,10 +253,11 @@ Once you've created the `Application` class and called `onCreate`, follow these } ``` -1. Import the following classes: +5. Import the following classes: - `com.adjust.adobeextension.AdjustAdobeExtension` - `com.adjust.adobeextension.AdjustAdobeExtensionConfig` -1. Create a new instance of `AdjustAdobeExtensionConfig` with the following argument: + +6. Create a new instance of `AdjustAdobeExtensionConfig` with the following argument: {% deflist %} `environment`: `String` @@ -296,7 +297,7 @@ Once you've created the `Application` class and called `onCreate`, follow these } ``` -1. Call `AdjustAdobeExtension.setConfiguration` with your `AdjustAdobeExtensionConfig` instance as an argument to configure the Adjust SDK extension. +7. Call `AdjustAdobeExtension.setConfiguration` with your `AdjustAdobeExtensionConfig` instance as an argument. ```java import android.app.Application; @@ -332,7 +333,7 @@ Once you've created the `Application` class and called `onCreate`, follow these Once you've configured the Adjust Extension, you need to register it with the Adobe Experience SDK. To do this: -1. Create a new `try...catch` block underneath your configuration block. +1. Create a new `try...catch` block below your configuration block. ```java import android.app.Application; @@ -369,8 +370,9 @@ Once you've configured the Adjust Extension, you need to register it with the Ad } ``` -1. Import the `com.adobe.marketing.mobile.Extension` class. -1. Within your `try` block, create a new list of extensions you want to register. In this example, we import the `Analytics` and `Identity` extensions in addition to the `AdjustAdobeExtension`. +2. Import the `com.adobe.marketing.mobile.Extension` class. + +3. Within your `try` block, create a new list of the extensions you want to register. The example in this guide imports the `Analytics` and `Identity` extensions in addition to the `AdjustAdobeExtension`. ```java import android.app.Application; @@ -414,7 +416,7 @@ Once you've configured the Adjust Extension, you need to register it with the Ad } ``` -1. Import the `com.adobe.marketing.mobile.AdobeCallback` class and call the `MobileCore.registerExtensions` method with the following arguments: +4. Import the `com.adobe.marketing.mobile.AdobeCallback` class and call the `MobileCore.registerExtensions` method with the following arguments: {% deflist %} `extensions`: `List>` @@ -474,4 +476,6 @@ Once you've configured the Adjust Extension, you need to register it with the Ad } ``` -Once you've completed these steps, build and run your app. In your `LogCat` viewer, set the filter `tag:Adjust` to show only logs relating to the Adjust Extension. After you launch your app, you should see the following message: `Install tracked`. +Once you've completed these steps, build and run your app. + +In your `LogCat` viewer, set the filter `tag:Adjust` to show only logs relating to the Adjust Extension. After you launch your app, you should see the message `Install tracked`. diff --git a/src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc b/src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc index 1c7cb08094..7982b1f8a7 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/preinstalled.mdoc @@ -5,7 +5,7 @@ description: Configure a campaign to send information from preinstalled apps. sidebar-position: 7 --- -You can use the Adjust Android Extension for Adobe Experience SDK to send activity to Adjust from apps that came preinstalled on a user's device. This enables you to send information from users who didn't download your app from a campaign. +You can use the Adjust Android Extension for Adobe Experience SDK to send Adjust activity from apps that came preinstalled on a user's device. This enables you to send information from users who didn't download your app from a campaign. You can send data from preinstalled apps to a predefined default link. When a user opens the app for the first time, the install session is associated with the default link token. @@ -19,13 +19,13 @@ To set your default link token, call the `setDefaultTracker` method of your `Adj : Your alphanumeric Adjust link token. {% /deflist %} -## Tutorial {% #tutorial %} +## Example: Define a default link token for preinstalled apps {% #example-define-default-link-token-preinstalled-apps %} -This tutorial demonstrates how to define a default link token for preinstalled apps. +This code sample demonstrates how to set a default link token for preinstalled apps. 1. [Create a new campaign link in Campaign Lab](https://help.adjust.com/en/article/links) and copy the link token. -1. Call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with your link token. -1. Initialize the Adjust Android Extension for Adobe Experience SDK to set the configuration. +2. Call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with your link token. +3. Initialize the Adjust Android Extension for Adobe Experience SDK to set the configuration. ```java String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; diff --git a/src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc b/src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc index 5cafc18a2c..2301e8b954 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/push-tokens.mdoc @@ -4,33 +4,27 @@ description: Configure push tokens for audiences and uninstall and reinstall mea sidebar-position: 6 --- -Push notifications enable you to deliver personalized content to your users. You can use deep links in push notifications to direct users to specific locations in your app and measure reattributions. +Push notifications enable you to deliver personalized content to your users. You can use deep links to direct users to specific pages in your app, and measure reattributions. -Each device generates a push token that is unique to the device. This is the token that is used to target the device with push notifications. To communicate a device's push token with Adjust, you can add it to your `AdjustAdobeExtensionConfig` instance. +Each device generates a unique push token that's used to target it. To communicate a device's push token with Adjust, add it to your `AdjustAdobeExtensionConfig` instance. -The push token is a unique identifier that can be used to sort [Audiences](https://help.adjust.com/en/article/audiences) and client callbacks. Push tokens are also required for [Uninstall and reinstall measurement](https://help.adjust.com/en/article/uninstalls-reinstalls). +- The push token is a unique identifier that can be used to sort [Audiences](https://help.adjust.com/en/article/audiences) and client callbacks. +- Push tokens are also required for [uninstall and reinstall measurement](https://help.adjust.com/en/article/uninstalls-reinstalls). -## Tutorial {% #tutorial %} +For more information about how to send event information to Adjust's servers when your users take specific actions, visit the [Send event information article](/en/sdk/adobe-extension/android/events#how-it-works). -To send your push token to Adjust, you need to call the `MobileCore.trackAction` API once you've obtained your token. To do this: +## Example: Send a push token {% #example-send-push-token %} -1. Assign the `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN` constant to a variable. -1. Create a new HashMap to hold your `contextData`. -1. Add the following values to your `contextData` HashMap: - - Key: `AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN` - - Value: your push token -1. Call the `MobileCore.trackAction` method and pass the following arguments: - {% deflist %} - `action`: `String` - - : Pass the variable mapped to the `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN` constant. +This code sample demonstrates how to use the `MobileCore.trackAction` API to send your push token to Adjust. - `contextData`: `Map` +To configure your event, follow these steps: - : Pass your HashMap. - {% /deflist %} - -In the example below, the push token is set to "your_push_token". +1. Create a new variable called `action`. +2. Assign `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN` to the variable you created. +3. Create a HashMap to hold your Adjust push token. The example below sets the following `contextData`: + - Key: `AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN` + - Value: _your_push_token_ +4. Send the information to Adjust: Pass the `action` variable and HashMap to the `MobileCore.trackAction` method. ```java String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; diff --git a/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc index 6e43884fa2..6f55eedd79 100644 --- a/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc +++ b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc @@ -5,7 +5,7 @@ sidebar-label: Android v3 migration guide sidebar-position: 1 --- -The Adjust Extension for Adobe Experience SDK has been updated to v3 to support Adjust Android SDK v5. Follow this guide to migrate from v2 to v3. +The [Adjust Extension for Adobe Experience SDK](https://github.com/adjust/android_adobe_extension) has been updated to v3 to support Adjust Android SDK v5. Follow this guide to migrate from v2 to v3. ## Before you begin {% #before-you-begin %} @@ -15,7 +15,7 @@ If your app targets API versions lower than [**21**](https://developer.android.c To install v3 of the Adjust Android Extension for Adobe, update the dependency declarations in your `build.gradle` as follows: -1. `com.adjust.adobeextension:adobextension` MUST be updated to 3.0.0 or later. +1. `com.adjust.adobeextension:adobeextension` MUST be updated to 3.0.0 or later. 1. `com.adjust.sdk:adjust-android` MUST be updated to 5.0.0 or later. ```groovy @@ -35,7 +35,7 @@ The following APIs have been added in v3. ### Resolve short branded links {% #resolve-short-branded-links %} -v3 of the Adjust Extension for Adobe Experience SDK adds support for resolving [short branded links](https://help.adjust.com/en/article/short-branded-links). Call the `Adjust.processAndResolveDeeplink` method with the following arguments to resolve shortened links: +v3 of the Adjust Extension for Adobe Experience SDK adds support for resolving [short branded links](https://help.adjust.com/en/article/short-branded-links). To resolve shortened links, call the `Adjust.processAndResolveDeeplink` method with the following arguments: {% deflist %} `adjustDeeplink`: `AdjustDeeplink` @@ -82,6 +82,8 @@ Adjust.addGlobalCallbackParameter("gc_foo", "gc_bar"); Adjust.addGlobalCallbackParameter("gc_key", "gc_value"); ``` +Learn how to [set up global callback](/en/sdk/adobe-extension/android/global-parameters#global-callback-parameters). + ### Global partner parameters {% #global-partner-parameters %} v3 of the Adjust Extension for Adobe Experience SDK adds support for the global partner parameters API from Android SDK v5. To add global partner parameters, call the `Adjust.addGlobalPartnerParameter` method with the following arguments: @@ -101,6 +103,8 @@ Adjust.addGlobalPartnerParameter("gc_foo", "gc_bar"); Adjust.addGlobalPartnerParameter("gc_key", "gc_value"); ``` +Learn how to [set up global partner parameters](/en/sdk/adobe-extension/android/global-parameters#global-partner-parameters). + ### Set external device ID {% #set-external-device-id %} v3 of the Adjust Extension for Adobe Experience SDK adds support for setting [external device identifiers](https://help.adjust.com/en/article/external-device-identifiers). To set an external device ID, call the `setExternalDeviceId` method of your `AdjustAdobeExtensionConfig` instance with the following argument: @@ -118,7 +122,9 @@ config.setExternalDeviceId("{YourExternalDeviceId}"); AdjustAdobeExtension.setConfiguration(config); ``` -### Set default link token {% #set-default-link-token %} +Learn how to [configure external device IDs](/en/sdk/adobe-extension/android/external-device-id). + +### Set default link token for preinstalled apps {% #set-default-link-token-preinstalled-apps %} v3 of the Adjust Extension for Adobe Experience SDK adds support for setting a default [link token](https://help.adjust.com/en/article/links) for recording preinstalled app installs to a default campaign. To set a default link token, call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with the following argument: @@ -135,6 +141,8 @@ config.setDefaultTracker("{Token}"); AdjustAdobeExtension.setConfiguration(config); ``` +Learn how to [send preinstalled app activity](/en/sdk/adobe-extension/android/preinstalled). + ## Changed APIs {% #changed-apis %} {% minorversion changed="v3" size="large" /%} @@ -143,7 +151,7 @@ The following APIs have changed in v3. ### Retrieve device ADID {% #retrieve-device-adid %} -In SDK v2, the `AdjustAttribution` class has a property called `adid`. In SDK v3, the `adid` property has been removed from the `AdjustAttribution` class. You can retrieve the device's ADID asynchronously by calling `Adjust.getAdid`. +In SDK v2, the `AdjustAttribution` class has a property called `adid`. This property has been removed. You can retrieve the device's ADID asynchronously, by calling `Adjust.getAdid`. ```java Adjust.getAdid(new OnAdidReadListener() { @@ -176,6 +184,8 @@ AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); ``` +Learn how to [reattribute users with direct deep links](/en/sdk/adobe-extension/android/deep-linking#reattribute-users-with-direct-deep-links). + ### Deferred deep linking callback {% #deferred-deep-linking-callback %} In SDK v2, you can configure the SDK to launch a callback function when a deferred deep link is opened by passing a function to the `setOnDeeplinkResponseListener` method of your `AdjustAdobeExtensionConfig` instance. @@ -197,7 +207,7 @@ config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { AdjustAdobeExtension.setConfiguration(config); ``` -In SDK v3, this method has been renamed to `setOnDeferredDeeplinkResponseListener`. +In SDK v3, the `setOnDeeplinkResponseListener` method has been renamed to `setOnDeferredDeeplinkResponseListener`. ```java AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); @@ -215,3 +225,5 @@ config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListe AdjustAdobeExtension.setConfiguration(config); ``` + +Learn how to [work with deferred deep link callbacks](/en/sdk/adobe-extension/android/deep-linking#deferred-deep-link-callbacks). From bbfc6bc153990b443781824dc00b58e6a945f922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 8 Nov 2024 10:41:02 +0100 Subject: [PATCH 06/22] Apply some changes from review --- .../sdk/adobe-extension/android/events.mdoc | 8 ++++---- .../adobe-extension/android/integration.mdoc | 20 +++++++++++-------- .../adobe-extension/android/index.mdoc | 6 +++--- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/content/docs/en/sdk/adobe-extension/android/events.mdoc b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc index e7b1e81a9d..43c9d49eb9 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/events.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc @@ -62,26 +62,26 @@ contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); Add callback parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, it sends all callback parameters to your callback URL. -- Key: `AdjustAdobeExtension.ADOBE_ADJUST_CALLBACK_PARAM_PREFIX` plus your string parameter key. +- Key: `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX` plus your string parameter key. - Value: Your parameter value. ```java Map contextData = new HashMap(); contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CALLBACK_PARAM_PREFIX + "key1", "value1"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key1", "value1"); ``` ### Add partner parameters {% #add-partner-parameters %} Add partner parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, it sends all partner parameters to any external partners you've configured. -- Key: `AdjustAdobeExtension.ADOBE_ADJUST_PARTNER_PARAM_PREFIX` plus your string parameter key. +- Key: `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX` plus your string parameter key. - Value: Your parameter value. ```java Map contextData = new HashMap(); contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PARTNER_PARAM_PREFIX + "key1", "value1"); +contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key1", "value1"); ``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc b/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc index 9a20d3901a..56f8c9e495 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/integration.mdoc @@ -5,9 +5,9 @@ sidebar-position: 1 sidebar-label: Integration guide --- -This is a step-by-step guide to help you integrate and configure the Adjust extension in your Adobe Experience app for Android. With this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information. +This is a step-by-step guide to help you integrate and configure the Adjust Extension in your Adobe Experience app for Android. With this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information. -This extension enables you to send installs, sessions, custom in-app events, and other types of data to Adjust. Follow this guide to set up, configure, and verify your integration. +This extension enables you to send installs, sessions, custom in-app events, and other types of data to Adjust. Follow this guide to set up and configure the Adjust Extension and verify that you can send install information to Adjust. ## Set up your project {% #set-up-your-project %} @@ -81,6 +81,7 @@ import android.util.Log; import com.adjust.adobeextension.AdjustAdobeExtension; import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.AdobeCallback; import com.adobe.marketing.mobile.Extension; import com.adobe.marketing.mobile.Analytics; import com.adobe.marketing.mobile.Identity; @@ -374,6 +375,12 @@ Once you've configured the Adjust Extension, you need to register it with the Ad 3. Within your `try` block, create a new list of the extensions you want to register. The example in this guide imports the `Analytics` and `Identity` extensions in addition to the `AdjustAdobeExtension`. + {% deflist %} + `extensions`: `List>` + + : Your list of extensions. + {% /deflist %} + ```java import android.app.Application; import android.util.Log; @@ -416,13 +423,9 @@ Once you've configured the Adjust Extension, you need to register it with the Ad } ``` -4. Import the `com.adobe.marketing.mobile.AdobeCallback` class and call the `MobileCore.registerExtensions` method with the following arguments: +4. Import the `com.adobe.marketing.mobile.AdobeCallback` class and call the `MobileCore.registerExtensions` method with your list of extensions and the following callback argument: {% deflist %} - `extensions`: `List>` - - : Your list of extensions. - `completionCallback`: `AdobeCallback` : A callback function that fires when registration completes. @@ -434,6 +437,7 @@ Once you've configured the Adjust Extension, you need to register it with the Ad import com.adjust.adobeextension.AdjustAdobeExtension; import com.adjust.adobeextension.AdjustAdobeExtensionConfig; + import com.adobe.marketing.mobile.AdobeCallback; import com.adobe.marketing.mobile.Extension; import com.adobe.marketing.mobile.Analytics; import com.adobe.marketing.mobile.Identity; @@ -478,4 +482,4 @@ Once you've configured the Adjust Extension, you need to register it with the Ad Once you've completed these steps, build and run your app. -In your `LogCat` viewer, set the filter `tag:Adjust` to show only logs relating to the Adjust Extension. After you launch your app, you should see the message `Install tracked`. +In your log viewer, set the filter `tag:Adjust` to show only logs relating to the Adjust Extension. After you launch your app, you should see the message `Install tracked`. diff --git a/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc index 6f55eedd79..26f553316f 100644 --- a/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc +++ b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc @@ -7,9 +7,9 @@ sidebar-position: 1 The [Adjust Extension for Adobe Experience SDK](https://github.com/adjust/android_adobe_extension) has been updated to v3 to support Adjust Android SDK v5. Follow this guide to migrate from v2 to v3. -## Before you begin {% #before-you-begin %} - -If your app targets API versions lower than [**21**](https://developer.android.com/tools/releases/platforms#5.0) you MUST update your app before migrating. +{% callout type="important" %} +You need to update your app to support [Android API 21](https://developer.android.com/tools/releases/platforms#5.0) or above before migrating. +{% /callout %} ## Install the SDK {% #install-the-sdk %} From feaa1244229881f24003db28aeb4aa45ef6b21f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 8 Nov 2024 13:25:52 +0100 Subject: [PATCH 07/22] Update events guide --- .../sdk/adobe-extension/android/events.mdoc | 78 +++++-------------- 1 file changed, 19 insertions(+), 59 deletions(-) diff --git a/src/content/docs/en/sdk/adobe-extension/android/events.mdoc b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc index 43c9d49eb9..68dcdf27e2 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/events.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/events.mdoc @@ -13,7 +13,7 @@ For more information on configuring events in Adjust, visit the [Add events guid Event information is sent to Adjust when the following information is passed to the `MobileCore.trackAction` API: 1. `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT`: a string value that maps to the Adjust `trackEvent` method. -2. `contextData`: a HashMap of values used to configure your event. +1. `contextData`: a HashMap of values used to configure your event. When you call `MobileCore.trackAction` with these arguments, the Adjust extension creates an event instance, passes it to the `trackEvent` method, and sends the information to Adjust. @@ -21,69 +21,29 @@ When you call `MobileCore.trackAction` with these arguments, the Adjust extensio The `contextData` HashMap holds information about an event. Each event is represented by a unique `contextData` HashMap. To configure your event instance, add values to HashMap. -## Configure and send information {% #configure-send-information %} +The following keys are supported: -When you configure your event, you MUST set your event token. This token corresponds with an event in Adjust. See [Add events](https://help.adjust.com/en/article/add-events#manage-your-events) for more information. +{% deflist %} +`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN` -### Set your event token {% #set-your-event-token %} +: Your Adjust event token. You MUST set this value to send event information to Adjust. See [Add events](https://help.adjust.com/en/article/add-events#manage-your-events) for more information. -To set your event token, add the following to your `contextData` HashMap: +`AdjustAdobeExtension.ADOBE_ADJUST_REVENUE` -- Key: `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN`. -- Value: Your Adjust event token. +: The amount of revenue associated with the event. This value should be a string that represents a numerical value. -```java -Map contextData = new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -``` - -### Add revenue information {% #add-revenue-information %} - -To send revenue information with your event, add the revenue amount and currency to your `contextData` HashMap. - -To set the event revenue, add the following data to your HashMap: - -- Key: `AdjustAdobeExtension.ADOBE_ADJUST_REVENUE`. -- Value: The amount of revenue associated with the event. This value should be a string that represents a numerical value. +`AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY`. -To set the currency, add the following data to your HashMap: +: An [ISO 4217](https://www.iban.com/currency-codes) currency code. -- Key: `AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY`. -- Value: An [ISO 4217](https://www.iban.com/currency-codes) currency code. - -```java -Map contextData = new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "0.25"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); -``` +`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX` -### Add callback parameters {% #add-callback-parameters %} +: Append a callback parameter key to this prefix and add your callback parameter value to send callbacks to Adjust. -Add callback parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, it sends all callback parameters to your callback URL. - -- Key: `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX` plus your string parameter key. -- Value: Your parameter value. - -```java -Map contextData = new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key1", "value1"); -``` - -### Add partner parameters {% #add-partner-parameters %} - -Add partner parameters by adding key-value pairs to your `contextData` HashMap. When Adjust receives your event instance, it sends all partner parameters to any external partners you've configured. - -- Key: `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX` plus your string parameter key. -- Value: Your parameter value. - -```java -Map contextData = new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key1", "value1"); -``` +`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX` +: Append a partner parameter key to this prefix and add your partner parameter value to send callbacks to third parties. +{% /deflist %} ## Example: Send event information {% #example-send-event-information %} @@ -92,13 +52,13 @@ This code sample demonstrates how to use the `MobileCore.trackAction` API to sen To configure your event, follow these steps: 1. Create a new variable called `action`. -2. Assign `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT` to the variable you created. -3. Create a HashMap to hold your Adjust event token. The example below sets the following properties: +1. Assign `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT` to the variable you created. +1. Create a HashMap to hold your Adjust event token. The example below sets the following properties: - The event token is _abc123_. - - A callback parameter with the value _callback_value_. - - A partner parameter with the value _partner_value_. + - A callback parameter with the value _callback\_value_. + - A partner parameter with the value _partner\_value_. - The event revenue is _0.25 EUR_. -4. Send the information to Adjust: Pass the `action` variable and HashMap to the `MobileCore.trackAction` method. +1. Send the information to Adjust: Pass the `action` variable and HashMap to the `MobileCore.trackAction` method. ```java String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; From d4a32b747cdadca80f8d918b93f3d7a63c168ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 8 Nov 2024 13:42:23 +0100 Subject: [PATCH 08/22] Fix version fetch script --- src/integrations/fetchSdkVersions.ts | 63 ++++++++++++++++------------ 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/src/integrations/fetchSdkVersions.ts b/src/integrations/fetchSdkVersions.ts index 976e9190e5..947a5390b7 100644 --- a/src/integrations/fetchSdkVersions.ts +++ b/src/integrations/fetchSdkVersions.ts @@ -2,53 +2,61 @@ import { Octokit } from "@octokit/core"; const octokit = new Octokit({ auth: import.meta.env.VITE_GITHUB_TOKEN }); +// Define type for SDK versions with multiple tags (v4, v5, etc.) +type MultiVersionTags = { + [versionKey: string]: string; +}; + +// Define the main type for the version replacements +type VersionReplacements = { + [platform: string]: MultiVersionTags | string; +}; + +const versionReplacements: VersionReplacements = { + android: { v4: "x.x.x", v5: "x.x.x" }, + ios: { v4: "x.x.x", v5: "x.x.x" }, + unity: { v4: "x.x.x", v5: "x.x.x" }, + react_native: { v4: "x.x.x", v5: "x.x.x" }, + cordova: { v4: "x.x.x", v5: "x.x.x" }, + flutter: { v4: "x.x.x", v5: "x.x.x" }, + cocos2dx: { v4: "x.x.x", v5: "x.x.x" }, + android_adobe_extension: { v2: "x.x.x", v3: "x.x.x" }, + web: "x.x.x", + windows: "x.x.x", +}; + type TagNode = { node: { name: string; }; }; -// Define the shape of a single version tag response type VersionTagResponse = { refs: { edges: TagNode[]; }; }; -// Make the GraphQL response flexible to handle different version keys (v2, v3, etc.) +// GraphQL response with dynamic keys for each version query type GraphQLResponse = { [key: string]: VersionTagResponse; }; -let versionReplacements: VersionMap = { - android: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, - ios: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, - unity: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, - react_native: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, - cordova: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, - flutter: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, - cocos2dx: { versions: { v4: "x.x.x", v5: "x.x.x" }, useSdkSuffix: true }, - android_adobe_extension: { - versions: { v2: "x.x.x", v3: "x.x.x" }, - useSdkSuffix: false, - }, - web: { versions: "x.x.x", useSdkSuffix: true }, - windows: { versions: "x.x.x", useSdkSuffix: true }, -}; - /** - * Queries the GitHub GraphQL endpoint for the latest versioned tag of each platform - * @returns A VersionMap of the latest versions of each SDK + * Queries the GitHub GraphQL endpoint for the latest versioned tags of each SDK platform. + * @returns A map of SDK platforms and their latest tags for each version. */ export async function fetchVersions() { try { if (import.meta.env.PROD) { - const fetchPromises = Object.keys(versionReplacements).map( - async (platform) => { - const { versions, useSdkSuffix } = versionReplacements[platform]; + const fetchPromises = Object.entries(versionReplacements).map( + async ([platform, versions]) => { + const useSdkSuffix = !["android_adobe_extension"] + .includes(platform); const repoName = `${platform}${useSdkSuffix ? "_sdk" : ""}`; if (typeof versions === "object") { + // For platforms with multiple versions (v4, v5, etc.) const versionQueries = Object.keys(versions) .map( (versionKey) => ` @@ -78,15 +86,18 @@ export async function fetchVersions() { const response = await octokit.graphql(query); + // Update each version tag in the output map Object.keys(versions).forEach((versionKey) => { const tag = response[`${versionKey}Tags`]?.refs.edges[0]?.node.name.replace( "v", "", ) || "Not found"; - versions[versionKey] = tag; + (versionReplacements[platform] as MultiVersionTags)[versionKey] = + tag; }); } else { + // For platforms with a single latest tag (no version keys like v4, v5) const query = ` query RepositoryTags { latestTag: repository(owner: "adjust", name: "${repoName}") { @@ -107,9 +118,9 @@ export async function fetchVersions() { `; const response = await octokit.graphql(query); - versionReplacements[platform].versions = + versionReplacements[platform] = response.latestTag?.refs.edges[0]?.node.name.replace("v", "") || - "Not found"; + "x.x.x"; } }, ); From 349f8f4cd6a9f6fe0383427ad6a8dd48b87cce91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 8 Nov 2024 13:44:34 +0100 Subject: [PATCH 09/22] Address remaining feedback --- .../adobe-extension/android/global-parameters.mdoc | 14 ++++++-------- .../migration/adobe-extension/android/index.mdoc | 8 ++++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc b/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc index e65d83b7a7..c36d633b59 100644 --- a/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/android/global-parameters.mdoc @@ -32,8 +32,8 @@ To add a global callback parameter, call the `Adjust.addGlobalCallbackParameter` You can add multiple parameters by calling the `Adjust.addGlobalCallbackParameter` method multiple times. ```java -Adjust.addGlobalCallbackParameter("gc_foo", "gc_bar"); -Adjust.addGlobalCallbackParameter("gc_key", "gc_value"); +Adjust.addGlobalCallbackParameter("key", "value"); +Adjust.addGlobalCallbackParameter("user_id", "855"); ``` ### Remove a global callback parameter {% #remove-global-callback-parameter %} @@ -44,11 +44,10 @@ To remove a global callback parameter, call the `Adjust.removeGlobalCallbackPara `key`: `String` : The key of the parameter you want to remove. - {% /deflist %} ```java -Adjust.removeGlobalCallbackParameter("gc_key"); +Adjust.removeGlobalCallbackParameter("key"); ``` ### Remove all global callback parameters {% #remove-all-global-callback-parameter %} @@ -90,8 +89,8 @@ To add a global partner parameter, call the `Adjust.addGlobalPartnerParameter` m You can add multiple parameters by calling the `Adjust.addGlobalPartnerParameter` method multiple times. ```java -Adjust.addGlobalPartnerParameter("gc_foo", "gc_bar"); -Adjust.addGlobalPartnerParameter("gc_key", "gc_value"); +Adjust.addGlobalPartnerParameter("key", "value"); +Adjust.addGlobalPartnerParameter("user_id", "855"); ``` ### Remove a global partner parameter {% #remove-global-partner-parameter %} @@ -102,11 +101,10 @@ To remove a global partner parameter, call the `Adjust.removeGlobalPartnerParame `key`: `String` : The key of the parameter you want to remove. - {% /deflist %} ```java -Adjust.removeGlobalPartnerParameter("gc_key"); +Adjust.removeGlobalPartnerParameter("key"); ``` ### Remove all global partner parameters {% #remove-all-global-partner-parameter %} diff --git a/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc index 26f553316f..6c496400be 100644 --- a/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc +++ b/src/content/docs/en/sdk/migration/adobe-extension/android/index.mdoc @@ -78,8 +78,8 @@ v3 of the Adjust Extension for Adobe Experience SDK adds support for the global {% /deflist %} ```java -Adjust.addGlobalCallbackParameter("gc_foo", "gc_bar"); -Adjust.addGlobalCallbackParameter("gc_key", "gc_value"); +Adjust.addGlobalCallbackParameter("key", "value"); +Adjust.addGlobalCallbackParameter("user_id", "855"); ``` Learn how to [set up global callback](/en/sdk/adobe-extension/android/global-parameters#global-callback-parameters). @@ -99,8 +99,8 @@ v3 of the Adjust Extension for Adobe Experience SDK adds support for the global {% /deflist %} ```java -Adjust.addGlobalPartnerParameter("gc_foo", "gc_bar"); -Adjust.addGlobalPartnerParameter("gc_key", "gc_value"); +Adjust.addGlobalPartnerParameter("key", "value"); +Adjust.addGlobalPartnerParameter("user_id", "855"); ``` Learn how to [set up global partner parameters](/en/sdk/adobe-extension/android/global-parameters#global-partner-parameters). From b8ff4f662c2adb4145353b09392864888cc3a789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 11 Nov 2024 10:03:18 +0100 Subject: [PATCH 10/22] Initial tutorial work --- ec.config.mjs | 10 +- package-lock.json | 27 + package.json | 1 + src/components/CodeBlock.astro | 3 + .../android/_MainActivity.mdoc | 78 +++ .../sdk/adobe-extension/android/_MainApp.mdoc | 66 +++ .../android/_activity_main.mdoc | 77 +++ .../adobe-extension/android/attribution.mdoc | 10 +- .../android/external-device-id.mdoc | 2 +- .../en/sdk/adobe-extension/android/index.mdoc | 4 + .../adobe-extension/android/integration.mdoc | 481 ++++++++++++++---- .../adobe-extension/android/preinstalled.mdoc | 6 +- .../adobe-extension/android/push-tokens.mdoc | 12 +- .../sdk/adobe-extension/android/tutorial.mdoc | 229 +++++++++ 14 files changed, 877 insertions(+), 129 deletions(-) create mode 100644 src/content/docs/en/sdk/adobe-extension/android/_MainActivity.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/_MainApp.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/_activity_main.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/android/tutorial.mdoc diff --git a/ec.config.mjs b/ec.config.mjs index 40562e7d20..573e0a392a 100644 --- a/ec.config.mjs +++ b/ec.config.mjs @@ -1,14 +1,16 @@ -import { defineEcConfig } from 'astro-expressive-code' +import { defineEcConfig } from 'astro-expressive-code'; import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections"; +import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers"; export default defineEcConfig({ defaultProps: { - wrap: true + wrap: true, + showLineNumbers: true, }, // This is where you can pass your plugin options - plugins: [pluginCollapsibleSections()], + plugins: [pluginCollapsibleSections(), pluginLineNumbers()], frames: { - extractFileNameFromCode: false + extractFileNameFromCode: true }, styleOverrides: { textMarkers: { diff --git a/package-lock.json b/package-lock.json index 0c5b138668..3f8be2025d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@astrojs/sitemap": "^3.2.1", "@astrojs/tailwind": "^5.1.2", "@expressive-code/plugin-collapsible-sections": "^0.35.6", + "@expressive-code/plugin-line-numbers": "^0.38.3", "@nanostores/persistent": "^0.10.2", "@nanostores/react": "^0.7.3", "@octokit/core": "^6.1.2", @@ -1585,6 +1586,32 @@ "@expressive-code/core": "^0.35.6" } }, + "node_modules/@expressive-code/plugin-line-numbers": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-line-numbers/-/plugin-line-numbers-0.38.3.tgz", + "integrity": "sha512-QbK9NL44ST9w5ANVEu0a7fkjlq+fXgxyPqiSyFC4Nw/sAXd0MUwT1C8V0qlve4pZYLz53CR9tn4JQQbR0Z1tOg==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.38.3" + } + }, + "node_modules/@expressive-code/plugin-line-numbers/node_modules/@expressive-code/core": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.38.3.tgz", + "integrity": "sha512-s0/OtdRpBONwcn23O8nVwDNQqpBGKscysejkeBkwlIeHRLZWgiTVrusT5Idrdz1d8cW5wRk9iGsAIQmwDPXgJg==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^4.0.4", + "hast-util-select": "^6.0.2", + "hast-util-to-html": "^9.0.1", + "hast-util-to-text": "^4.0.1", + "hastscript": "^9.0.0", + "postcss": "^8.4.38", + "postcss-nested": "^6.0.1", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1" + } + }, "node_modules/@expressive-code/plugin-shiki": { "version": "0.35.6", "resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.35.6.tgz", diff --git a/package.json b/package.json index ddb5b8f03d..b6a1bc05c5 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@astrojs/sitemap": "^3.2.1", "@astrojs/tailwind": "^5.1.2", "@expressive-code/plugin-collapsible-sections": "^0.35.6", + "@expressive-code/plugin-line-numbers": "^0.38.3", "@nanostores/persistent": "^0.10.2", "@nanostores/react": "^0.7.3", "@octokit/core": "^6.1.2", diff --git a/src/components/CodeBlock.astro b/src/components/CodeBlock.astro index e4c48c3cea..ba1100993d 100644 --- a/src/components/CodeBlock.astro +++ b/src/components/CodeBlock.astro @@ -10,6 +10,7 @@ interface Props { ins?: string; del?: string; useDiffSyntax?: boolean; + showLineNumbers?: boolean; } const { @@ -19,6 +20,7 @@ const { del, collapse, useDiffSyntax = false, + showLineNumbers = true, } = Astro.props as Props; let content = ""; @@ -79,4 +81,5 @@ const parsedCollapse = collapse ? parseCollapse(collapse) : undefined; del={parsedDel} code={code} useDiffSyntax={useDiffSyntax} + showLineNumbers={showLineNumbers} /> diff --git a/src/content/docs/en/sdk/adobe-extension/android/_MainActivity.mdoc b/src/content/docs/en/sdk/adobe-extension/android/_MainActivity.mdoc new file mode 100644 index 0000000000..94201c39fe --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/_MainActivity.mdoc @@ -0,0 +1,78 @@ +```java +// MainActivity.java +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; + +import androidx.appcompat.app.AppCompatActivity; + +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustDeeplink; +import com.adobe.marketing.mobile.MobileCore; + +import java.util.HashMap; +import java.util.Map; + +public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() { + @Override + public void onDeeplinkResolved(String s) { + Log.d("example", "Unwrapped short link: " + s); + } + }); + } + + public void sendEvent(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "event_token", "g3mfiw"); + + MobileCore.trackAction(action, contextData); + } + + public void sendPushToken(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "de18dbf8-f38a-4962-8f1e-44abcf43055d"); + + MobileCore.trackAction(action, contextData); + } + + public void addGlobalCallbackParameters(View view) { + Adjust.addGlobalCallbackParameter("user_id", "855"); + } + + public void removeGlobalCallbackParameter(View view) { + Adjust.removeGlobalCallbackParameter("user_id"); + } + + public void removeGlobalCallbackParameters(View view) { + Adjust.removeGlobalPartnerParameters(); + } + + public void addGlobalPartnerParameters(View view) { + Adjust.addGlobalPartnerParameter("user_id", "855"); + } + + public void removeGlobalPartnerParameter(View view) { + Adjust.removeGlobalPartnerParameter("user_id"); + } + + public void removeGlobalPartnerParameters(View view) { + Adjust.removeGlobalPartnerParameters(); + } +} +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/_MainApp.mdoc b/src/content/docs/en/sdk/adobe-extension/android/_MainApp.mdoc new file mode 100644 index 0000000000..5d0bfe299b --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/_MainApp.mdoc @@ -0,0 +1,66 @@ +```java +// MainApp.java +import android.app.Application; +import android.util.Log; + +import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.AdobeCallback; +import com.adobe.marketing.mobile.Extension; +import com.adobe.marketing.mobile.Analytics; +import com.adobe.marketing.mobile.Identity; +import com.adobe.marketing.mobile.LoggingMode; +import com.adobe.marketing.mobile.MobileCore; + +public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(environment); + + config.setExternalDeviceId("{YOUR_EXTERNAL_DEVICE_ID}"); + + config.setDefaultTracker("{TOKEN}"); + + config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { + return true; + } else { + return false; + } + } + }); + + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } +} +``` diff --git a/src/content/docs/en/sdk/adobe-extension/android/_activity_main.mdoc b/src/content/docs/en/sdk/adobe-extension/android/_activity_main.mdoc new file mode 100644 index 0000000000..cf9bf83d72 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/android/_activity_main.mdoc @@ -0,0 +1,77 @@ +```xml +// activity_main.xml + + + +