Mobile SDK end-of-life has been announced and scheduled for the end of 2023, in favor of updated and more streamlined app personalization using server-side APIs.
Custom Actions let you add or manipulate any element on your mobile app. You can change, move, swap element with almost no limitation. This lets you fully utilize Dynamic Yield’s optimization and personalization capabilities to leverage any modification you want to try out.
You define JSON code in the Dynamic Yield admin and the targeting conditions that determine when it will be pushed to your application. In your application, you use a listener method to define code that will run whenever a custom action is triggered.
Use Cases
Because Custom Actions can do just about anything, there are many different use cases.
- Test different Call-to-Action design and copy.
- Personalize the order of items in a menu and serve different variations to different audiences.
Creating a Custom Action
In Dynamic Yield Admin
- Go to App Personalization › Custom Actions and click Add New.
- Specify the trigger and frequency settings that will be applied to every experience you create in the campaign. For details, see below.
- Configure the targeting settings of the experience to determine when, where, and for whom the experience is displayed.
Important: If targeting conditions are not set, the action may execute on every single screen of your application (depending on your frequency settings as well).
- Create variations by entering the JSON code you want to push to your app. When you are done with each variation, click Save Variation.
- Set the allocation, primary metric, and advanced experience settings.
- Configure how much of your traffic to allocate to each variation, and if you want to allocate any traffic to the control group.
- Click Save Experience.
- Click the plus icon to create an additional targeted experience.
- Click Save and Publish.
In Your Mobile Application
Define or edit the following listener method in the listener class you defined during implementation of Dynamic Yield. Here is where you can define code that will use the JSON data to perform your desired action.
- iOS: onSmartAction
- Android: onSmartActionReturned
Every time a pageview occurs, Dynamic Yield checks to see if the targeting and frequency conditions are met. If they are, a variation of the campaign is pushed to this method with the data and ID of the custom action, which runs any code you defined in the method.
Custom Action Settings
When you begin creating a Custom Action, you need to complete the following settings before creating any variations.
Trigger
- Page Load – execute the action immediately upon pageload of the relevant pages (the specific pages are defined in the Targeting step upon adding variations)
- Time on Page – execute the action only after a certain amount of time has passed since pageload
- Event – execute the action only once a specific Event has been fired on the page
- Advanced – allows you to set a logical combination of the triggers specified above.
Frequency
- Once per pageview – Your visitors will be exposed to the action each and every time they meet the targeting conditions, with every new pageload
- Once per session – Your visitors will be served the action once they meet the targeting conditions, and will no longer be exposed to it during the remaining pageviews of their session
- Once per day/ week month – Your visitors will be served the action once they meet the targeting conditions, and will not be exposed to it on any pageview during the remainder of the day, week, or month, depending on the timeframe selection
- Once per user – Your visitors will be served the action once they meet the targeting conditions, and will not be exposed to it ever again