Expand my Community achievements bar.

SOLVED

Setting a numeric success event with the mobile SDK

Avatar

Level 2

Hi everyone!

Just wondered how you go about setting a numeric success event with the mobile SDK.

I want to work out the average number of downloaded items a customer has in their downloads page. What I'm thinking is I pass the number of items as context data and then when I'm setting up the processing rule I say to set my numeric success event to the context data key value? Is it as simple as that? I'm conscious that although I'm sending a number, the context data is a string, so I'm not sure if the processing rule will coerce it into a number.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 5

 

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 (num_items). The 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:

  1. 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.

  2. 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.

  3. 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.

  4. 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:

  1. Navigate to the Processing Rules section in Adobe Analytics.

  2. Click on the Create Rule button and give your rule a name.

  3. In the Conditions section, select the Success Event exists condition.

  4. In the Actions section, select Set Variables.

  5. In the Set Variables section, set the variable type to Numeric and set the variable name to "Average Number of Downloads".

  6. In the Set Variables section, set the value of the variable to the value of the num_items context data key.

  7. 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.

 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 5

 

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 (num_items). The 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:

  1. 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.

  2. 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.

  3. 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.

  4. 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:

  1. Navigate to the Processing Rules section in Adobe Analytics.

  2. Click on the Create Rule button and give your rule a name.

  3. In the Conditions section, select the Success Event exists condition.

  4. In the Actions section, select Set Variables.

  5. In the Set Variables section, set the variable type to Numeric and set the variable name to "Average Number of Downloads".

  6. In the Set Variables section, set the value of the variable to the value of the num_items context data key.

  7. 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.