The following sample shows how to attach data to all outgoing TrackAction
Analytics network requests. To create this type of rule, select your property in the Data Collection UI and complete the following steps.
Create a rule
- On the Rules tab, select Create New Rule.
If you do not have existing rules for this property, the Create New Rule button will be in the middle of the screen. If your property has rules, the button will be in the top right of the screen.
Select an event
Give your rule an easily recognizable name in your list of rules.
In this example, the rule is named "Attach Places Data to Analytics Track Action Events".
Under the Events section, select Add.
From the Extension dropdown list, select Mobile Core.
From the Event Type dropdown list, select Track Action.
Select Keep Changes.
Define the action
- Under the Actions section, select Add.
- From the Extension dropdown list, select Mobile Core.
- From the Action Type dropdown list, select Attach Data.
- On the right pane, in the JSON Payload field, type the data that will be added to this event.
- Select Keep Changes.
On the right pane, you can add a freeform JSON payload that adds data to an SDK event before an extension that is listening for this event can hear the event. In this example, some context data is added to this event before the Adobe Analytics extension processes it. The added context data will now be on the outgoing Adobe Analytics hit.
In the following example, launches
and anAddedKey
keys are added to the contextdata
of the Analytics event. Values for the new keys can either be hardcoded in the rule, or dynamically determined by the SDK when this event processes by using data elements.
Save the rule and rebuild your property
After you complete your configuration, verify that your rule looks like the following:
- Select Save
- Rebuild your mobile property and deploy it to the correct Environment.