Mobile Data Campaigns

Mobile Data Campaigns are custom campaigns that allow the app developer to define the campaign’s data structure and rendering within the app. Once the app has defined campaign handlers, you can flexibly trigger them using Mobile Data Campaign(s), including rendering dynamic content such as product recommendations.

To create a Mobile Data Campaign, do the following.

  1. Log in to the Personalization UI and select the Dataset.
  2. From the left-hand menu, click Mobile > Mobile Data Campaigns, and then click New Campaign > Mobile Data.
  3. Name the campaign.
  4. Enter the target for the campaign. The campaign target is an app-defined string that uniquely identifies the payload data schema - what the data represents and its purpose. For our example, the campaign target is Featured Product.
  5. Click Add New to create a key-value pair that will contain the data sent to the mobile app. The code example from CampaignHandler uses a static key-value pair "featuredProductName":"cameras".
  6. Add rules that define campaign eligibility by clicking Setup > Campaign Settings.
    • Required: Configure one or more Action rules for the entire campaign by navigating to Campaign Wide Rules > Target Pages > New Rule, and then selecting Action from the Select Rule Type dropdown menu. Alternatively, you can set up Action rules for all experiences by navigating to Experiences > Edit Mobile Message Settings > Target Pages > New Rule, and then selecting Action from the Select Rule Type dropdown menu.

      To prevent campaigns from being eligible for every event, you must scope campaigns to one or more specific actions, typically matching a screen action. Doing so reduces bandwidth usage and latency, and ensures that only relevant campaigns are returned.

    • Recommended: Configure Source rules matching one or more specific native mobile apps by navigating to Campaign Wide Rules > Target Users > New Rule, and then selecting Source from the Select Rule Type dropdown menu. Doing so ensures that campaigns are only returned for relevant apps, thereby reducing bandwidth usage and latency. For more information, see the Tracking guide.
  7. Set the campaign to the Testing or Published (for non-production datasets) state to allow users to see it. When unpublished, you can view the campaign by entering test URLs in the mobile browser on the device. For more information, see the Testing Guide and the EvergageActivity class documentation.

In the Activity's onStart() method, define a CampaignHandler, overriding the handleCampaign(campaign) method to validate and process the campaign data. Call setCampaignHandler(handler, target) to register the handler for the campaign target. For example code, see CampaignHandler.

Personalization delivers campaigns in response to events/actions. Therefore, track the screen and any relevant actions and item interactions. For more information on tracking, see the Tracking guide. The campaign's action rule (recommended above) will be one of these actions.

You can also track clickthroughs and dismissal actions on campaigns that can be clicked or dismissed. To enable clickthrough and dismissal tracking, provide the Campaign from the campaign handler to the appropriate method when the user clicks or dismisses the message.

For instance, inside a button's onClick listener:

Personalization calls the campaign handler every time the app sends an event that triggers a campaign in response. Therefore, it is up to you as a developer to determine what to do with the event data. If the app is already displaying a campaign, you could redisplay the campaign with the new data or do nothing in response. If the campaign is already dismissed, you could redisplay it and track an impression or, again, do nothing.

The handler may receive a campaign equivalent to the last one, in which case you would likely want to redisplay the campaign. You can compare campaigns by using the Campaign's equals method. For example code that uses this method, see the code example in the CampaignHandler documentation.

Personalization can call the campaign handler multiple times. For instance, Personalization may call the campaign handler again to pass in a new featured product through a campaign. As a developer, do you want the campaign to display the existing featured product or replace it with the new one? The behavior is for you to decide; Personalization is responsible for providing the app's campaign content and leaves the decisioning on handling new content to you.

  • For information on testing your campaigns, see the Testing guide.