In-App Click Actions

How to Create Click Actions for an In-App Message for example using a URL, tagging users and sending outcomes

2574

Image. Shows the flow of using Click Actions to form Location and Push prompts for iOS

Click Actions can be added to all blocks enabling your users to click onto the element. Click actions can include the following abilities:

ActionDescription
URLLeaves the app and opens the default browser to the URL you specify.
Push Permission PromptShows the native iOS or Android Push Permission Prompt.
- If iOS or Android device is currently subscribed, prevents the In-App Message from showing.
- If iOS or Android device is currently unsubscribed and has been prompted previously, it will show a native alert asking the user to enable push notifications in the app settings.
Location Permission PromptShows the native operating system prompt to ask permission for location tracking. See Location Opt-In Prompt for details on setup.
Sent OutcomeTracks user interaction for analytics purposes. Outcomes sent through In-App messages will show as "Unattributed" Outcomes and will set a tag on the user in format outcome name : true.

Read more about Custom Outcomes.
Tag UserAdds data tags to a user to express interest and later segment into another group based on user response to send more targeted messaging.
Custom Action IDPass a custom value when clicked. The value can be read with the OneSignal SDK IAM Click Listener Lifecycle method.

Used for custom action handling like:
- Click detection to perform custom event like send data to your own server or analytics vendor.
- Deep Linking within the app.

How to collect custom click actions

When an Image or Button block is clicked, you can use the Custom Action ID and set a value to identify that block was clicked. This Action ID can then be detected through the OneSignal SDK IAM Click Listener Lifecycle method and that data can be sent to your server/date base/analytics vendor.

Example: Create a Poll

If you want to survey your users with a multiple choice questionnaire and then display their choices within the app. You can setup the Action ID per button to be a unique identifier for that option. Whenever that option is clicked, it will be detected in the OneSignal SDK IAM Click Listener Lifecycle method. From there, you can make an API request to your server to store that data and access it within the app later to display to your users.


How to deep link within the app

To deep link into another page of the app, you can use the URL or Custom Action ID click action.

Depending on the type of deep link you setup, you can select the Custom Action ID click action and set the the deep link URI into the Action Name field.

Upon the block getting clicked, this Action Name will be available within the OneSignal SDK IAM Click Listener Lifecycle method within the actionId property. For example:

"result": {"actionId": "your URI", ... }

Within the event listener, you can handle your deep link as needed.


How to Create a Rating Action

The URL click action will allow you to easily deep link to the App Store, details on getting your app store links:

More details, see Example: Ask for App Store Rating.