Newer Version Available
Let us know so we can improve!
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.
Featured Product.CampaignHandler uses a static key-value pair "featuredProductName":"cameras".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.
Important
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:
1button.setOnClickListener(new View.OnClickListener() {
2 @Override
3 public void onClick(View v) {
4 Screen screen = Evergage.getInstance().getScreenForActivity(this);
5 if (screen != null) {
6 screen.trackClickthrough(activeCampaign);
7 }
8 // other code ...
9 }
10});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 avoid redisplaying 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.
Newer Version Available