Custom Actions
Custom actions track user interactions in your mobile app. When the app calls the Marketo SDK to send a custom action, the SDK first saves the action to the device. The SDK sends the action after it detects adequate internet connectivity, so Marketo might receive the action after a delay.
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 a custom action.
| code language-objectivec |
|---|
|
| code language-swift |
|---|
|
Send a custom action with metadata.
| code language-objectivec |
|---|
|
| code language-swift |
|---|
|
Report all saved actions immediately.
| code language-objectivec |
|---|
|
| code language-swift |
|---|
|
Sending Custom Actions on Android
-
Send a custom action.
code language-none Marketo.reportAction("Login", null); -
Send a 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 saved custom actions immediately.
code language-none Marketo.reportAll();
Troubleshooting Custom Actions
Custom action names sent from the Mobile SDK to Marketo must be fewer than 20 characters.
Multi-user use cases on a shared device: When a user logs in to a mobile app that uses the Marketo SDK, the first call associates the lead with the app installation. After the call succeeds, subsequent user activities appear in the lead’s activity log.
The association call is asynchronous. Custom actions logged immediately after login might be associated with the previously logged-in user until the call succeeds.