diff --git a/gatsby-config.js b/gatsby-config.js index efce9dd634..d6ffb080fd 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -125,6 +125,16 @@ module.exports = { title: "Validation", path: "/edge/edge-network/validation" }, + { + title: "Tutorials", + path: "/edge/edge-network/tutorials", + pages: [ + { + title: "Datastream config overrides using rules", + path: "/edge/edge-network/tutorials/datastream-config-override-rules" + } + ] + }, { title: "Release notes", path: "/edge/edge-network/release-notes" @@ -739,4 +749,4 @@ module.exports = { }, plugins: [`@adobe/gatsby-theme-aio`], pathPrefix: process.env.PATH_PREFIX || '/client-sdks/' -}; \ No newline at end of file +}; diff --git a/src/pages/edge/edge-network/api-reference.md b/src/pages/edge/edge-network/api-reference.md index 86d8764278..757ddec042 100644 --- a/src/pages/edge/edge-network/api-reference.md +++ b/src/pages/edge/edge-network/api-reference.md @@ -60,6 +60,15 @@ See [MobileCore.resetIdentities](../../home/base/mobile-core/api-reference.md#re Sends an Experience event to Adobe Experience Platform Edge Network. + + +Starting with `Edge` extension version **2.4.0** (Android) and **4.3.0** (iOS), the `sendEvent` API supports optional datastream overrides. This allows you to adjust your datastreams without the need for new ones or modifications to existing settings. + +The process involves two steps: + +1. Define your Datastream configuration overrides on the [datastream configuration page](https://experienceleague.adobe.com/docs/experience-platform/datastreams/configure.html). +2. Send these overrides to the Edge Network using the `sendEvent` API. + Android diff --git a/src/pages/edge/edge-network/assets/tutorial/configOverrides/datastream-config-override-payload.png b/src/pages/edge/edge-network/assets/tutorial/configOverrides/datastream-config-override-payload.png new file mode 100644 index 0000000000..dcbbec523e Binary files /dev/null and b/src/pages/edge/edge-network/assets/tutorial/configOverrides/datastream-config-override-payload.png differ diff --git a/src/pages/edge/edge-network/assets/tutorial/configOverrides/datastream-id-override-payload.png b/src/pages/edge/edge-network/assets/tutorial/configOverrides/datastream-id-override-payload.png new file mode 100644 index 0000000000..80e3b8749a Binary files /dev/null and b/src/pages/edge/edge-network/assets/tutorial/configOverrides/datastream-id-override-payload.png differ diff --git a/src/pages/edge/edge-network/assets/tutorial/configOverrides/final-rule-configoverrides.png b/src/pages/edge/edge-network/assets/tutorial/configOverrides/final-rule-configoverrides.png new file mode 100644 index 0000000000..aa568d5b6e Binary files /dev/null and b/src/pages/edge/edge-network/assets/tutorial/configOverrides/final-rule-configoverrides.png differ diff --git a/src/pages/edge/edge-network/assets/tutorial/configOverrides/if-event-application-close.png b/src/pages/edge/edge-network/assets/tutorial/configOverrides/if-event-application-close.png new file mode 100644 index 0000000000..155b205f34 Binary files /dev/null and b/src/pages/edge/edge-network/assets/tutorial/configOverrides/if-event-application-close.png differ diff --git a/src/pages/edge/edge-network/assets/tutorial/configOverrides/if-event-application-launch.png b/src/pages/edge/edge-network/assets/tutorial/configOverrides/if-event-application-launch.png new file mode 100644 index 0000000000..6ff57bbe79 Binary files /dev/null and b/src/pages/edge/edge-network/assets/tutorial/configOverrides/if-event-application-launch.png differ diff --git a/src/pages/edge/edge-network/tabs/api-reference.md b/src/pages/edge/edge-network/tabs/api-reference.md index 73bedf924d..79e85ba986 100644 --- a/src/pages/edge/edge-network/tabs/api-reference.md +++ b/src/pages/edge/edge-network/tabs/api-reference.md @@ -134,7 +134,7 @@ Edge.getLocationHint { (hint, error) in **Example** ```objectivec -[AEPMobileEdge getLocationHint:^(NSString *hint, NSError *error) { +[AEPMobileEdge getLocationHint:^(NSString *hint, NSError *error) { // handle the error and the hint here }]; ``` @@ -186,7 +186,7 @@ Use the AEPMobileCore API to register the Edge extension. **Syntax** ```objectivec -+ (void) registerExtensions: (NSArray* _Nonnull) extensions ++ (void) registerExtensions: (NSArray* _Nonnull) extensions completion: (void (^ _Nullable)(void)) completion; ``` @@ -199,14 +199,15 @@ Use the AEPMobileCore API to register the Edge extension. ``` - + #### Java **Syntax** ```java -public static void sendEvent(final ExperienceEvent experienceEvent, final EdgeCallback callback); +public static void sendEvent(final ExperienceEvent experienceEvent, + final EdgeCallback callback); ``` * _experienceEvent_ - the XDM [Experience Event](#experienceevent) to be sent to Adobe Experience Platform Edge Network @@ -219,7 +220,7 @@ public static void sendEvent(final ExperienceEvent experienceEvent, final EdgeCa Map xdmData = new HashMap<>(); xdmData.put("eventType", "SampleXDMEvent"); xdmData.put("sample", "data"); - + ExperienceEvent experienceEvent = new ExperienceEvent.Builder() .setXdmSchema(xdmData) .build(); @@ -235,7 +236,84 @@ Edge.sendEvent(experienceEvent, null); Edge.sendEvent(experienceEvent, new EdgeCallback() { @Override public void onComplete(final List handles) { - // Handle the Edge Network response + // Handle the Edge Network response + } +}); +``` + +##### Example with Datastream ID override + +```java +// Create experience event from Map +Map xdmData = new HashMap<>(); +xdmData.put("eventType", "SampleXDMEvent"); +xdmData.put("sample", "data"); + +ExperienceEvent experienceEvent = new ExperienceEvent.Builder() + .setXdmSchema(xdmData) + .setDatastreamIdOverride("SampleDatastreamId") + .build(); + +Edge.sendEvent(experienceEvent, new EdgeCallback() { + @Override + public void onComplete(final List handles) { + // Handle the Edge Network response + } +}); +``` + +##### Example with Datastream config override + +```java +// ----------------- Datastream config overrides map start ----------------- +Map configOverrides = new HashMap<>(); + +// com_adobe_experience_platform +Map experiencePlatform = new HashMap<>(); +Map datasets = new HashMap<>(); + +Map eventDataset = new HashMap<>(); +eventDataset.put("datasetId", "SampleEventDatasetIdOverride"); + +Map profileDataset = new HashMap<>(); +profileDataset.put("datasetId", "SampleProfileDatasetIdOverride"); + +datasets.put("event", eventDataset); +datasets.put("profile", profileDataset); + +experiencePlatform.put("datasets", datasets); +configOverrides.put("com_adobe_experience_platform", experiencePlatform); + +// com_adobe_analytics +Map analytics = new HashMap<>(); +analytics.put("reportSuites", new String[]{"rsid1", "rsid2", "rsid3"}); +configOverrides.put("com_adobe_analytics", analytics); + +// com_adobe_identity +Map identity = new HashMap<>(); +identity.put("idSyncContainerId", "1234567"); +configOverrides.put("com_adobe_identity", identity); + +// com_adobe_target +Map target = new HashMap<>(); +target.put("propertyToken", "SamplePropertyToken"); +configOverrides.put("com_adobe_target", target); +// ----------------- Datastream config overrides map end ----------------- + +// Create experience event from Map +Map xdmData = new HashMap<>(); +xdmData.put("eventType", "SampleXDMEvent"); +xdmData.put("sample", "data"); + +ExperienceEvent experienceEvent = new ExperienceEvent.Builder() + .setXdmSchema(xdmData) + .setDatastreamConfigOverride(configOverrides) + .build(); + +Edge.sendEvent(experienceEvent, new EdgeCallback() { + @Override + public void onComplete(final List handles) { + // Handle the Edge Network response } }); ``` @@ -244,7 +322,7 @@ Edge.sendEvent(experienceEvent, new EdgeCallback() { **Example** -```java +```kotlin // Create Experience Event from map val xdmData = mutableMapOf() xdmData["eventType"] = "SampleXDMEvent" @@ -255,19 +333,73 @@ val experienceEvent = ExperienceEvent.Builder() .build() ``` -```java +```kotlin // Example 1 - send the Experience Event without handling the Edge Network response Edge.sendEvent(experienceEvent, null) ``` -```java +```kotlin // Example 2 - send the Experience Event and handle the Edge Network response onComplete Edge.sendEvent(experienceEvent) { - // Handle the Edge Network response + // Handle the Edge Network response } ``` - +##### Example with Datastream ID override + +```kotlin +// Create experience event from Map +val xdmData = mutableMapOf() +xdmData["eventType"] = "SampleXDMEvent" +xdmData["sample"] = "data" + +val experienceEvent = ExperienceEvent.Builder() + .setXdmSchema(xdmData) + .setDatastreamIdOverride("SampleDatastreamId") + .build() + +Edge.sendEvent(experienceEvent) { + // Handle the Edge Network response +} +``` + +##### Example with Datastream config override + +```kotlin +// Create experience event from Map +val xdmData = mutableMapOf() +xdmData["eventType"] = "SampleXDMEvent" +xdmData["sample"] = "data" + +val configOverrides = mapOf( + "com_adobe_experience_platform" to mapOf( + "datasets" to mapOf( + "event" to mapOf("datasetId" to "SampleEventDatasetIdOverride"), + "profile" to mapOf("datasetId" to "SampleProfileDatasetIdOverride") + ) + ), + "com_adobe_analytics" to mapOf( + "reportSuites" to listOf("rsid1", "rsid2", "rsid3") + ), + "com_adobe_identity" to mapOf( + "idSyncContainerId" to "1234567" + ), + "com_adobe_target" to mapOf( + "propertyToken" to "SamplePropertyToken" + ) + ) + +val experienceEvent = ExperienceEvent.Builder() + .setXdmSchema(xdmData) + .setDatastreamConfigOverride(configOverrides) + .build() + +Edge.sendEvent(experienceEvent) { + // Handle the Edge Network response +} +``` + + #### Swift @@ -297,8 +429,61 @@ Edge.sendEvent(experienceEvent: experienceEvent) ```swift // Example 2 - send the Experience Event and handle the Edge Network response onComplete Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in - // Handle the Edge Network response - } + // Handle the Edge Network response +} +``` + +##### Example with Datastream ID override + +```swift +// Create Experience event from dictionary +var xdmData : [String: Any] = ["eventType" : "SampleXDMEvent", + "sample": "data"] +let experienceEvent = ExperienceEvent(xdm: xdmData, datastreamIdOverride: "SampleDatastreamId") + +Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in + // Handle the Edge Network response +} +``` + +##### Example with Datastream config override + +```swift +// Create Experience event from dictionary +var xdmData : [String: Any] = ["eventType" : "SampleXDMEvent", + "sample": "data"] + +let configOverrides: [String: Any] = [ + "com_adobe_experience_platform": [ + "datasets": [ + "event": [ + "datasetId": "SampleEventDatasetIdOverride" + ], + "profile": [ + "datasetId": "SampleProfileDatasetIdOverride" + ] + ] + ], + "com_adobe_analytics": [ + "reportSuites": [ + "rsid1", + "rsid2", + "rsid3" + ] + ], + "com_adobe_identity": [ + "idSyncContainerId": "1234567" + ], + "com_adobe_target": [ + "propertyToken": "SamplePropertyToken" + ] + ] + +let experienceEvent = ExperienceEvent(xdm: xdmData, datastreamConfigOverride: configOverrides) + +Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in + // Handle the Edge Network response +} ``` #### Objective-C @@ -329,6 +514,57 @@ NSDictionary *data = @{ @"sample" : @"data"}; }]; ``` +##### Example with Datastream ID override + +```objectivec +// Create Experience event from dictionary: +NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"}; +NSDictionary *data = @{ @"sample" : @"data"}; +AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data datastreamIdOverride: @"SampleDatastreamIdOverride"]; + +[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray * _Nonnull handles) { + // Handle the Edge Network response +}]; +``` + +##### Example with Datastream config override + +```objectivec +// Create Experience event from dictionary: +NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"}; +NSDictionary *data = @{ @"sample" : @"data"}; +NSDictionary *configOverrides = @{ @"com_adobe_experience_platform" : @{ + @"datasets" : @{ + @"event" : @{ + @"datasetId": @"SampleEventDatasetIdOverride" + }, + @"profile" : @{ + @"datasetId": @"SampleProfileDatasetIdOverride" + } + } + }, + @"com_adobe_analytics" : @{ + @"reportSuites" : @[ + @"rsid1", + @"rsid2", + @"rsid3", + ] + }, + @"com_adobe_identity" : @{ + @"idSyncContainerId": @"1234567" + }, + @"com_adobe_target" : @{ + @"propertyToken": @"SamplePropertyToken" + } + } + +AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data datastreamConfigOverride: configOverrides]; + +[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray * _Nonnull handles) { + // Handle the Edge Network response +}]; +``` + #### Java @@ -475,13 +711,13 @@ public protocol XDMSchema: Encodable { */ public class EdgeEventHandle { /** - * @return the payload type or null if not found in the {@link JSONObject} response - */ + * @return the payload type or null if not found in the {@link JSONObject} response + */ public String getType() {...} /** - * @return the event payload values for this {@link EdgeEventHandle} or null if not found in the {@link JSONObject} response - */ + * @return the event payload values for this {@link EdgeEventHandle} or null if not found in the {@link JSONObject} response + */ public List> getPayload() {...} } ``` @@ -516,57 +752,87 @@ public final class ExperienceEvent { } /** - * Sets free form data associated with this event to be passed to Adobe Experience Edge. - * - * @param data free form data, JSON like types are accepted - * @return instance of current builder - * @throws UnsupportedOperationException if this instance was already built - */ + * Sets free form data associated with this event to be passed to Adobe Experience Edge. + * + * @param data free form data, JSON like types are accepted + * @return instance of current builder + * @throws UnsupportedOperationException if this instance was already built + */ public Builder setData(final Map data) {...} /** - * Solution specific XDM event data for this event. - * - * @param xdm {@link Schema} information - * @return instance of current builder - * @throws UnsupportedOperationException if this instance was already built - */ + * Solution specific XDM event data for this event. + * + * @param xdm {@link Schema} information + * @return instance of current builder + * @throws UnsupportedOperationException if this instance was already built + */ public Builder setXdmSchema(final Schema xdm) {...} /** - * Solution specific XDM event data and dataset identifier for this event. - * - * @param xdm {@code Map} of raw XDM schema data - * @param datasetIdentifier The Experience Platform dataset identifier where this event is sent. - * If not provided, the default dataset defined in the configuration ID is used - * @return instance of current builder - * @throws UnsupportedOperationException if this instance was already built - */ + * Solution specific XDM event data and dataset identifier for this event. + * + * @param xdm {@code Map} of raw XDM schema data + * @param datasetIdentifier The Experience Platform dataset identifier where this event is sent. + * If not provided, the default dataset defined in the configuration ID is used + * @return instance of current builder + * @throws UnsupportedOperationException if this instance was already built + */ public Builder setXdmSchema(final Map xdm, final String datasetIdentifier) {...} /** - * Solution specific XDM event data for this event, passed as raw mapping of keys and - * Object values. - * - * @param xdm {@code Map} of raw XDM schema data - * @return instance of current builder - * @throws UnsupportedOperationException if this instance was already built - */ + * Solution specific XDM event data for this event, passed as raw mapping of keys and + * Object values. + * + * @param xdm {@code Map} of raw XDM schema data + * @return instance of current builder + * @throws UnsupportedOperationException if this instance was already built + */ public Builder setXdmSchema(final Map xdm) {...} /** - * Builds and returns a new instance of {@code ExperienceEvent}. - * - * @return a new instance of {@code ExperienceEvent} or null if one of the required parameters is missing - * @throws UnsupportedOperationException if this instance was already built - */ + * Override the default datastream identifier to send this event's data to a different datastream. + * + * When using {@link Edge#sendEvent}, this event is sent to the Experience Platform using the + * datastream identifier {@code datastreamIdOverride} instead of the default Experience Edge + * configuration ID set in the SDK Configuration key {@code edge.configId}. + * + * @param datastreamIdOverride Datastream identifier to override the default datastream identifier set in the Edge configuration + * @return instance of current builder + * @throws UnsupportedOperationException if this instance was already built + * + */ + public Builder setDatastreamIdOverride(final String datastreamIdOverride) {...} + + /** + * Override the default datastream configuration settings for individual services for this event. + * + * When using {@link Edge#sendEvent}, this event is sent to the Experience Platform along with the + * datastream overrides defined in {@code datastreamConfigOverride}. + * + * @param datastreamConfigOverride Map defining datastream configuration overrides for this Experience Event + * @return instance of current builder + * @throws UnsupportedOperationException if this instance was already built + */ + public Builder setDatastreamConfigOverride(final Map datastreamConfigOverride) {...} + + /** + * Builds and returns a new instance of {@code ExperienceEvent}. + * + * @return a new instance of {@code ExperienceEvent} or null if one of the required parameters is missing + * @throws UnsupportedOperationException if this instance was already built + */ public ExperienceEvent build() {...} } public Map getData() {...} - public Map getXdmSchema() {...} -} + public Map getXdmSchema() {...} + + public String getDatastreamIdOverride() {...} + + public Map getDatastreamConfigOverride() {...} +} ``` **Examples** @@ -647,21 +913,49 @@ public class ExperienceEvent: NSObject { /// Optional free-form data associated with this event @objc public let data: [String: Any]? + /// Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event + @objc public private(set) var datastreamIdOverride: String? + + /// Datastream configuration used to override individual settings from the default datastream configuration for this event + @objc public private(set) var datastreamConfigOverride: [String: Any]? + /// Adobe Experience Platform dataset identifier, if not set the default dataset identifier set in the Edge Configuration is used @objc public let datasetIdentifier: String? + /// Initialize an Experience Event with the provided event data + /// - Parameters: + /// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary. + /// - data: Any free form data in a [String : Any] dictionary structure. + @objc public init(xdm: [String: Any], data: [String: Any]? = nil) {...} + /// Initialize an Experience Event with the provided event data /// - Parameters: /// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary. /// - data: Any free form data in a [String : Any] dictionary structure. /// - datasetIdentifier: The Experience Platform dataset identifier where this event should be sent to; if not provided, the default dataset identifier set in the Edge configuration is used - @objc public init(xdm: [String: Any], data: [String: Any]? = nil, datasetIdentifier: String? = nil) {...} + @objc public convenience init(xdm: [String: Any], data: [String: Any]? = nil, datasetIdentifier: String? = nil) {...} + + /// Initialize an Experience Event with the provided event data + /// - Parameters: + /// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary. + /// - data: Any free form data in a [String : Any] dictionary structure. + /// - datastreamIdOverride: Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event. + /// - datastreamConfigOverride: Datastream configuration used to override individual settings from the default datastream configuration for this event. + @objc public convenience init(xdm: [String: Any], data: [String: Any]? = nil, datastreamIdOverride: String? = nil, datastreamConfigOverride: [String: Any]? = nil) {...} /// Initialize an Experience Event with the provided event data /// - Parameters: /// - xdm: XDM formatted event data passed as an XDMSchema /// - data: Any free form data in a [String : Any] dictionary structure. public init(xdm: XDMSchema, data: [String: Any]? = nil) {...} + + /// Initialize an Experience Event with the provided event data + /// - Parameters: + /// - xdm: XDM formatted event data passed as an XDMSchema + /// - data: Any free form data in a [String : Any] dictionary structure. + /// - datastreamIdOverride: Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event. + /// - datastreamConfigOverride: Datastream configuration used to override individual settings from the default datastream configuration for this event. + public convenience init(xdm: XDMSchema, data: [String: Any]? = nil, datastreamIdOverride: String? = nil, datastreamConfigOverride: [String: Any]? = nil) {...} } ``` @@ -696,7 +990,7 @@ public struct XDMSchemaExample : XDMSchema { enum CodingKeys: String, CodingKey { case eventType = "eventType" case otherField = "otherField" - } + } } extension XDMSchemaExample { @@ -733,14 +1027,14 @@ let experienceEvent = ExperienceEvent(xdm: xdmData, datasetIdentifier: "datasetI // Create Experience Event with both XDM and freeform data using dictionaries NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"}; NSDictionary *data = @{ @"sample" : @"data"}; - - AEPExperienceEvent *event = [[AEPExperienceEvent alloc] initWithXdm:xdmData data:data datasetIdentifier:nil]; + +AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data]; ``` ```objectivec // Example 2 // Set the destination Dataset identifier to the current Experience Event NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"}; - + AEPExperienceEvent *event = [[AEPExperienceEvent alloc] initWithXdm:xdmData data:nil datasetIdentifier:@"datasetIdExample"]; ``` diff --git a/src/pages/edge/edge-network/tutorials/datastream-config-override-rules.md b/src/pages/edge/edge-network/tutorials/datastream-config-override-rules.md new file mode 100644 index 0000000000..3b30461d03 --- /dev/null +++ b/src/pages/edge/edge-network/tutorials/datastream-config-override-rules.md @@ -0,0 +1,121 @@ +--- +title: Datastream config override for Edge events using Rules. +description: This guide provides instructions on overriding datastream ID and datastream configuration for Edge Network Requests that are not initiated by the sendEvent API, all accomplished through Tags Rules. +keywords: +- Edge Network +- Datastream config overrides +- Datastream ID override +- Guide +--- + +# Datastream config override for Edge events using Rules + +By default, all **Edge Experience events** are sent to the datastream specified in the **Adobe Experience Platform Edge Network** extension configuration settings. This tutorial offers examples on how to customize this configuration on a per-event basis + +## Prerequisites + +* [Edge](../../index.md) extension version >= **2.4.0** (Android) and >= **4.3.0** (iOS). +* [Configure datastreams](../../../home/getting-started/configure-datastreams.md) +* [Define overrides in your datastream configuration](https://experienceleague.adobe.com/docs/experience-platform/datastreams/configure.html?lang=en) + +## Steps to add datastream config overrides for Lifecycle Edge events using rules + +Let's add **datastream ID override** or **datastream config overrides** for `Lifecycle Edge` events of type **application.launch** and **application.close** by following the next steps. + +### Add a new rule for your mobile property + +Give your rule an easily recognizable name in your list of rules. +In this example, the rule is named "Attach datastream config overrides Data to Lifecycle Edge events". + +### Configure Lifecycle Edge Events + +Now we need to add two Lifecycle Edge events one of type **application.launch** and other of type **application.close**. + +#### Configure Lifecycle Edge event of type application.launch + +1. Under the **Events** section, select **Add**. +2. From the **Extension** dropdown list, select **Adobe Experience Platform Edge Network**. +3. From the **Event Type** dropdown list, select **AEP Request Event**. +4. On the right pane, click the plus button **Add XDM Event Type** and set the condition to **equals** with value **application.launch**. +5. Select **Keep Changes**. + +![Sample rule configuration application.launch event](../assets/tutorial/configOverrides/if-event-application-launch.png) + +#### Configure Lifecycle Edge event of type application.close + +1. Under the **Events** section, select **Add**. +2. From the **Extension** dropdown list, select **Adobe Experience Platform Edge Network**. +3. From the **Event Type** dropdown list, select **AEP Request Event**. +4. On the right pane, click the plus button **Add XDM Event Type** and set the condition to **equals** with value **application.close**. +5. Select **Keep Changes**. + +![Sample rule configuration application.close event](../assets/tutorial/configOverrides/if-event-application-close.png) + +Save the event configuration and return to the Rule Editor UI. + +### Configure Attach Data Action + +Based on the use case you can **either** attach payload for the **datastream ID override** or for the **datastream config overrides**: + +#### Configure the action to attach datastream ID override payload + +1. Under the **Actions** section, select **Add**. +2. From the **Extension** dropdown list, select **Mobile Core**. +3. From the **Action Type** dropdown list, select **Attach Data**. +4. On the right pane, in the **JSON Payload** field, type the config overrides data that will be added to this event. + + **Sample Payload for datastream ID override:** + + ```json + { + "config": { + "datastreamIdOverride": "SampleDatastreamID" + } + } + ``` + + ![Action configuration - Datastream ID override payload ](../assets/tutorial/configOverrides/datastream-id-override-payload.png) + +5. Select **Keep Changes**. +6. Return to the Rule Editor UI. + +#### Configure the action to attach datastream config override payload + + + +In order to use this feature, configuration overrides in this case event dataset override must be preset in the datastream configuration. Learn more about this [here](https://experienceleague.adobe.com/docs/experience-platform/datastreams/overrides.html?lang=en#event-dataset-overrides) + +1. Under the **Actions** section, select **Add**. +2. From the **Extension** dropdown list, select **Mobile Core**. +3. From the **Action Type** dropdown list, select **Attach Data**. +4. On the right pane, in the **JSON Payload** field, type the config overrides data that will be added to this event. + + **Sample Payload for datastream config overrides:** + + ```json + { + "config": { + "datastreamConfigOverride": { + "com_adobe_experience_platform": { + "datasets": { + "event": { + "datasetId": "SampleEventDatasetIdOverride" + } + } + } + } + } + } + ``` + + ![Action configuration - Datastream ID override payload ](../assets/tutorial/configOverrides/datastream-config-override-payload.png) + +5. Select **Keep Changes**. +6. Return to the Rule Editor UI. + +### Save the Rule and publish the updated library + +The final rule should appear as follows: +![File Rules configuration](../assets/tutorial/configOverrides/final-rule-configoverrides.png) + +**Save** this Rule, **publish** the new Tags library with all the changes, and your rule will be set and ready. Now, Lifecycle Edge events of type **application.launch** and **application.close** will be sent with the overridden datastream ID or datastream config overrides payload. diff --git a/src/pages/edge/edge-network/tutorials/index.md b/src/pages/edge/edge-network/tutorials/index.md new file mode 100644 index 0000000000..926139bbd8 --- /dev/null +++ b/src/pages/edge/edge-network/tutorials/index.md @@ -0,0 +1,12 @@ +--- +title: Adobe Experience Platform Edge Network tutorials +description: An overview of the available tutorials for the Adobe Experience Platform Edge Network extension. +keywords: +- Adobe Experience Platform Edge Network +- Guide +- Tutorial +--- + +# Adobe Experience Platform Edge Network - Tutorials + +* [Datastream config overrides using rules](./datastream-config-override-rules.md) diff --git a/src/pages/home/base/mobile-core/lifecycle/tabs/index.md b/src/pages/home/base/mobile-core/lifecycle/tabs/index.md index ac8e4a3315..673908d7f5 100644 --- a/src/pages/home/base/mobile-core/lifecycle/tabs/index.md +++ b/src/pages/home/base/mobile-core/lifecycle/tabs/index.md @@ -34,8 +34,8 @@ Add the AEPLifecycle extension and its dependency, the [Mobile Core](../index.md Add the following pods in your `Podfile`: ```pod -pod 'AEPCore','~>3.0' -pod 'AEPLifecycle','~>3.0' +pod 'AEPCore' +pod 'AEPLifecycle' ``` Import the Lifecycle library: @@ -98,8 +98,8 @@ super.onCreate(); 2. In the `onResume` function, start the lifecycle data collection: ```java - @Override - public void onResume() { + @Override + public void onResume() { MobileCore.setApplication(getApplication()); MobileCore.lifecycleStart(null); } @@ -138,7 +138,7 @@ If your iOS application supports background capabilities, your `application:didF ```swift func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - let appState = application.applicationState + let appState = application.applicationState MobileCore.registerExtensions([Lifecycle.self, ...], { if appState != .background { // only start lifecycle if the application is not in the background @@ -151,7 +151,7 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau 3. When launched, if your app is resuming from a backgrounded state, iOS might call your `applicationWillEnterForeground:` delegate method. You also need to call `lifecycleStart:`, but this time you do not need all of the supporting code that you used in `application:didFinishLaunchingWithOptions:`: ```swift -func applicationWillEnterForeground(_ application: UIApplication) { +func applicationWillEnterForeground(_ application: UIApplication) { MobileCore.lifecycleStart(additionalContextData: nil) } ``` @@ -169,7 +169,7 @@ For more information on handling foregrounding applications with Scenes, refer t 4. When the app enters the background, pause Lifecycle data collection from your app's `applicationDidEnterBackground:` delegate method: ```swift -func applicationDidEnterBackground(_ application: UIApplication) { +func applicationDidEnterBackground(_ application: UIApplication) { MobileCore.lifecyclePause() } ``` @@ -255,4 +255,4 @@ For more information on handling backgrounding applications with Scenes, refer t **Registering the extension with Core** -When using React Native, registering Lifecycle with Mobile Core should be done in native code which is shown under the Android and iOS (ACP 2.x) tabs. ---> \ No newline at end of file +When using React Native, registering Lifecycle with Mobile Core should be done in native code which is shown under the Android and iOS (ACP 2.x) tabs. --->