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 actually received by Marketo.
Custom actions can be used as triggers and filters in Smart Campaigns. For more information, see “Mobile App Activity” here.
Sending Custom Actions on iOS
1. Send custom action.
-
12Marketo *sharedInstance = [Marketo sharedInstance];[sharedInstance reportAction:@"Login" withMetaData:nil];
-
1sharedInstance.reportAction("Login", withMetaData:nil);
2. Send custom action with metadata.
-
1234567MarketoActionMetaData *meta = [[MarketoActionMetaData alloc] init];[meta setType:@"Shopping"];[meta setDetails:@"RedShirt"];[meta setLength:20];[meta setMetric:30];[sharedInstance reportAction:@"Bought Shirt" withMetaData:meta];
-
1234567let meta = MarketoActionMetaData()meta.setType("Shopping");meta.setDetails("RedShirt");meta.setLength(20);meta.setMetric(30);sharedInstance.reportAction("Bought Shirt", withMetaData:meta);
3. Report all actions immediately (send all saved actions).
-
1[sharedInstance reportAll];
-
1sharedInstance.reportAll();
Sending Custom Actions on Android
1. Send custom action.
-
1Marketo.reportAction("Login", null);
2. Send custom action with metadata.
-
1234567MarketoActionMetaData meta = new MarketoActionMetaData();meta.setActionType("Shopping");meta.setActionDetails("RedShirt");meta.setActionLength("20");meta.setActionMetric("30");Marketo.reportAction("Bought Shirt", meta);
3. Report all custom actions immediately (send all saved actions).
-
1Marketo.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.