To set a numeric success event with the mobile SDK, you can use the
trackAction method and pass in the appropriate parameters. Here's an example in iOS using Adobe Mobile SDK:
ACPCore.trackAction("download", data: ["num_items": 3])
ACPCore.trackAction("download", data: ["num_items": 5])
In this example, the
trackAction method is used to track a user action called "download". The second parameter is a dictionary of context data, which includes the number of items downloaded (
trackAction method can be called each time a user downloads an item, and the value of
num_items can be updated accordingly.
To calculate the average number of downloaded items, you can use a processing rule that sets the numeric success event to the
num_items context data key value. Adobe Analytics will automatically convert the string value of
num_items to a numeric value when the numeric success event is set.
To set up a numeric success event with the mobile SDK, you'll typically need to follow a few steps:
First, you'll need to define the success event in your Adobe Analytics report suite. You can do this by going to the Admin section, then selecting "Report Suites" and clicking on the appropriate suite. From there, choose "Edit Settings" and then "Success Events." You can then add a new numeric success event and give it a name.
Once you've defined the success event, you'll need to set it up in your mobile app using the Adobe Analytics mobile SDK. This will typically involve calling a method like "trackAction" or "trackState" with the appropriate parameters to trigger the event when the user performs a certain action.
In order to pass the number of downloaded items as context data, you can use the "trackAction" or "trackState" method to send the number as an eVar (conversion variable) or a custom dimension. This will ensure that the value is captured as a number in Adobe Analytics.
When setting up your processing rule, you can then map the eVar or custom dimension to the numeric success event that you defined in step 1. This will allow the value to be counted as a success event when it meets the criteria you've set.
It's worth noting that context data in Adobe Analytics is typically stored as strings, so if you pass a number as context data it will be stored as a string. However, when you map the context data to a numeric success event in your processing rule, Adobe Analytics will automatically convert the string to a number. So you should be able to pass the number of downloaded items as context data and have it count towards your numeric success event without any issues.
To set up the processing rule for calculating the average number of downloaded items, you can follow these steps in Adobe Analytics:
Navigate to the Processing Rules section in Adobe Analytics.
Click on the Create Rule button and give your rule a name.
In the Conditions section, select the Success Event exists condition.
In the Actions section, select Set Variables.
In the Set Variables section, set the variable type to Numeric and set the variable name to "Average Number of Downloads".
In the Set Variables section, set the value of the variable to the value of the num_items context data key.
Save the processing rule.
Now, when a success event is triggered with the num_items context data key set, Adobe Analytics will automatically convert the string value of num_items to a numeric value and set it as the value of the "Average Number of Downloads" variable. You can then use this variable to calculate the average number of downloaded items using Adobe Analytics' reporting features.