Learn how to map mobile data to Adobe Analytics.
The event data which you collected and sent to Platform Edge Network in earlier lessons is forwarded to the services configured in your datastream, including Adobe Analytics. You just need to map the data to the correct variables in your report suite.
In this lesson, you will:
Many of the standard XDM fields are automatically mapped to Analytics variables. See the full list here.
A good example is the products variable which can’t be populated using processing rules. With an XDM implementation, you pass all the necessary data in productListItems and s.products are automatically populated via Analytics mapping.
This object:
"productListItems": [
[
"name": "Yoga Mat",
"SKU": "5829",
"priceTotal": "49.99",
"quantity": 1
],
[
"name": "Water Bottle",
"SKU": "9841",
"priceTotal": "30.00",
"quantity": 3
]
]
Would result in the following:
s.products = ";Yoga Mat;1;49.99,;Water Bottle,3,30.00"
Currently productListItems[N].SKU
is ignored by automatic mapping.
If you look closely, all events have two fields value
(required) and id
(optional). The value
field is used to increment the event count. The id
field is used for serialization.
This object:
"commerce" : {
"productListAdds" : {
"value" : 1
}
}
Would result in the following:
s.events = "scAdd"
This object:
"commerce" : {
"productListAdds" : {
"value" : 1,
"id": "321435"
}
}
Would result in the following:
s.events = "scAdd:321435"
Using the Assurance QA tool you can confirm that you’re sending an ExperienceEvent, the XDM data is correct and the Analytics mapping is happening as expected. For example:
Send a productListAdds event.
var xdmData: [String: Any] = [
"eventType": "commerce.productListAdds",
"commerce": [
"productListAdds": [
"value": 1
]
],
"productListItems": [
[
"name": "neve studio dance jacket - (blue)",
"SKU": "test-sku",
"priceTotal": 69
]
]
]
let addToCartEvent = ExperienceEvent(xdm: xdmData)
Edge.sendEvent(experienceEvent: addToCartEvent)
View the ExperienceEvent hit.
Review the XDM portion of the JSON.
"xdm" : {
"productListItems" : [ {
"priceTotal" : 69,
"SKU" : "test-sku",
"name" : "neve studio dance jacket - (blue)"
} ],
"timestamp" : "2021-10-22T22:03:37Z",
"commerce" : {
"productListAdds" : {
"value" : 1
}
},
"eventType" : "commerce.productListAdds",
//...
}
Review the analytics.mapping
event.
Note the following in the Analytics mapping:
commerce.productListAdds
.productListItems
.XDM data forwarded to Analytics gets converted into context data including both standard and custom fields.
The context data key is constructed following this syntax:
a.x.[xdm path]
For example:
//Standard Field
a.x.commerce.saveforlaters.value
//Custom Field
a.x._techmarketingdemos.appinformationa.appstatedetails.screenname
Custom fields are placed under your Experience Cloud Org identifier.
“_techmarketingdemos” is replaced with your Org’s unique value.
Here is what a processing rule using this data might look like:
Some of the automatically mapped variables may not be available for use in processing rules.
The first time you map to a processing rule the UI does not show you the context data variables from the XDM object. To fix that select any value, Save, and come back to edit. All XDM variables should now appear.
Addition information about processing rules and context data can be found here.
Unlike previous mobile app implementations, there is no distinction between a page/screen views and other event. Instead you can increment the Page View metric by setting the Page Name dimension in a processing rule. Since you are collecting the custom screenName
field in the tutorial, it is highly recommended to map this to Page Name in a processing rule.
Next: Experience Platform
Thank you for investing your time in learning about Adobe Experience Platform Mobile SDK. If you have questions, want to share general feedback, or have suggestions on future content, please share them on this Experience League Community discussion post