Custom Actions
You can track user interaction by sending custom actions. When your mobile app calls into the Marketo SDK to send a custom action, the custom action is initially saved to the device. The Marketo SDK then checks to see if there is adequate internet connectivity before sending out the custom action. As a result, there can be a delay between the time the custom action is sent, and the time it is received by Marketo.
Custom actions can be used as triggers and filters in Smart Campaigns. For more information, see Mobile App Activity.
Sending Custom Actions on iOS
Send custom action.
code language-none |
---|
|
code language-none |
---|
|
Send custom action with metadata.
code language-none |
---|
|
code language-none |
---|
|
Report all actions immediately (send all saved actions).
code language-none |
---|
|
code language-none |
---|
|
Sending Custom Actions on Android
-
Send custom action.
code language-none Marketo.reportAction("Login", null);
-
Send custom action with metadata.
code language-none MarketoActionMetaData meta = new MarketoActionMetaData(); meta.setActionType("Shopping"); meta.setActionDetails("RedShirt"); meta.setActionLength("20"); meta.setActionMetric("30"); Marketo.reportAction("Bought Shirt", meta);
-
Report all custom actions immediately (send all saved actions).
code language-none Marketo.reportAll();
Troubleshooting Custom Actions
Setting up mobile custom actions is straightforward, but there are restrictions as to the number characters you can send from the Mobile SDK to Marketo. Ensure that all of your custom actions that report back to Marketo through the mobile SDK are fewer than 20 characters long.
Note on multi-user use cases on a shared device: When a user logs into a mobile app integrated with Marketo SDK, the first call is made to associate the lead with the app install. After this call successfully completes, further user activities in the app can be seen in the lead’s activity log. Note, as this is an asynchronous call if there are any custom actions logged immediately after login they may get associated with the user that was previously logged in until the associate call succeeds.