Urban Airship announced support for Apple Watch in February, and reporting is a major area of interest. This step-by-step guide provides instructions for implementing Custom Events and Tags to report on engagement and segment for future messaging.
If you want to identify when a user views a notification on their Apple Watch or interacts with that notification, and be able to create segments that include or exclude these users, follow these steps.
To make use of these features, you need to add our Watch Utils files to your app. Adding the Custom Events and Tags themselves is a simple task, which will require little developer effort.
Custom Events and Tags
Our Custom Events
In addition, our Tag
Where to Start
There are two main areas where Custom Events and Tags can be set to report on Apple Watch interactions, and to create segments based on this information:
- When a user views a long look notification interface on their Apple Watch
- When a user taps the long look notification interface itself, or an action button
Custom Event: Viewed a notification
This Custom Event will count the times that a user viewed a long look notification interface, which means they kept their wrist raised or tapped the short look notification to get more information. To implement this reporting, place the following code in the didReceiveRemoteNotification
method in the NotificationController.m
file:
[UAWatchUtils addCustomEventWithName:@"watch_received_notification" value:nil];
Custom Event: Tapped a notification or action button
This Custom Event will count the times a user interacted with a long look notification interface, which means they kept their wrist raised or tapped the short look notification to get more information, and then tapped the notification or an action button. Urban Airship automatically provides Custom Event reporting of our Interactive Notifications. You can accomplish the same type of reporting for Apple Watch. To implement this reporting, place the following code in the InterfaceController.m
file:
- (void)handleActionWithIdentifier:(NSString *)identifier
forRemoteNotification:(NSDictionary *)remoteNotification {
NSString *eventName;
if (identifier) {
eventName = [@"tapped_watch_button_" stringByAppendingString:identifier];
} else {
eventName = @"tapped_watch_notification";
}
[UAWatchUtils addCustomEventWithName:eventName];
}
You can add this code to any custom notification interfaces that you design, in addition to the default.
Tags: Apple Watch interactions
This Tag will allow you to create a segment that includes or excludes those users who have interacted with an Apple Watch notification in the past. Place the following code in the same place as addCustomEventWithName
:
[UAWatchUtils addTags:@[@"tagName"]];
This will allow for more specific messaging in the future, targeting only customers who have an Apple Watch, or no such customers.
Conclusion
Using existing Urban Airship functionality, it is easy to implement reporting and segmentation ability that will enhance the performance of Apple Watch in your messaging strategy. In addition to learning about your audience's engagement with messaging on Apple Watch, you can create segments to account for those users who have viewed notifications on an Apple Watch.