Campaigns
Use campaigns to create location-based notifications effortlessly. Campaigns let you customize your notification content and targeting behavior with ease.
#
QuickstartFirst, sign up for Radar and get an API key.
To use campaigns with geofences, start by creating geofences through the dashboard, a CSV import, or the API.
To use campaigns with places, ensure that places are enabled through the settings page and nearby places
is activated. Reach out to your account manager to enable nearby places
for your project. Then setup nearby places for the project via the settings page.
To use campaigns with events, ensure that the desired trigger events are enabled through the settings page.
To use campaigns with beacons, ensure that the beacons are created and enabled through the beacons page
Once set up, create your campaigns using the dashboard.
#
Create campaignsTo create a campaign via the dashboard, navigate to the campaigns page and click Create. Provide the campaign details, targeting options, and notification details.
Notifications will only be delivered if the campaign is set to Enabled.
#
Campaign types#
Client side geofence (iOS only)Use Radar's client side geofence notifications to display a notification on iOS devices when a user enters a geofence. These notifications work with foreground or "when in use" permissions, dramatically improving their reachable audience.
Radar's client side geofence notifications make use of location notification triggers on iOS. No location data is collected in the background.
Calls to Radar.trackOnce()
and Radar.startTracking()
, which can be configured through remote configuration in the dashboard, will return to the client nearby geofences with notifications, which will then be registered on the device. Default behavior involves syncing down geofences within 5 kilometers. To sync down geofences from further away, ask your Customer Success Manager to enable unlimited-distance syncing.
Radar only controls the registration of notifications on the device. Once that happens, surfacing notifications is subject to the system limits and heuristics that iOS enforces.
#
Event based notificationsEvent based notifications are the more traditional type of location-based notifications that rely on background Always allow
location permission. These types of notifications often provide less reach, but allow for more insight into conversions and analytics.
#
Beacon based notifications (iOS only)Use Radar's client side beacon notifications to display a notification on iOS devices when a user enters a beacon region. These notifications work with foreground or "when in use" permissions. Beacon based locations are much more accurate indoors as compared to GPS based locations, allowing for notification deliveries with high indoor accuracy.
#
In app messagingIn app messages give you a direct, flexible way to engage users right where they’re already active, without requiring push permissions or external channels. They’re a powerful developer tool for driving adoption, onboarding, and feature discovery with fully customizable timing and presentation.
Radar's in app messages allow you to deliver timely in app messages when we detect that the user is in a targeted geofence. No additional code is required to setup in app messages.
#
Life cycle hooks#
iOSclass MyRadarInAppMessageDelegate : NSObject, RadarInAppMessageProtocol {
// Called when the CTA button is clicked by the user and causes the in app message to be dismissed. open func onInAppMessageButtonClicked(_ message: RadarInAppMessage) { ... }
// Called when the dismiss button is clicked by the user and causes the in app messsage to be dismissed. open func onInAppMessageDismissed(_ message: RadarInAppMessage) { ... }
// Called just before the SDK displays the in app message. The return values decides if the in app message is displayed or discarded open func onNewInAppMessage(_ message: RadarInAppMessage) -> RadarInAppMessageOperation { ... }}
#
Androidclass MyInAppMessageReceiver : RadarInAppMessageReceiver {
// Called when the CTA button is clicked by the user and causes the in app message to be dismissed. override fun onInAppMessageButtonClicked(payload: RadarInAppMessage) { ... }
// Called when the dismiss button is clicked by the user and causes the in app message to be dismissed. override fun onInAppMessageDismissed(payload: RadarInAppMessage) { ... }
// Called just before the SDK displays the in app message. The return values decides if the in app message is displayed or discarded override fun onNewInAppMessage(payload: RadarInAppMessage): RadarInAppMessageOperation { ... }
}
#
Custom in app messagesThe Radar dashboard offers may ways to customize the look and feel of your in app messages. At the same time, we also allow developers to replace the in app message view with their very own custom in app message implementation.
#
AndroidImplement your own custom implementation of RadarInAppMessageReceiver
and override the method createInAppMessageView
. Then, either pass the RadarInAppMessageReceiver
as a parameter in Radar.initialize()
or to Radar.setInAppMessageReceiver()
class MyInAppMessageReceiver : RadarInAppMessageReceiver {
override fun createInAppMessageView( context: Context, inAppMessage: RadarInAppMessage, onDismissListener: (() -> Unit)? = null, onInAppMessageButtonClicked: (() -> Unit)? = null, onViewReady: (View) -> Unit ) { val inAppMessageView = myInAppMessageView.initialize( inAppMessage, onDismissListener, onInAppMessageButtonClicked, ) onViewReady(inAppMessageView) }}
#
iOSImplement your own custom implementation of an class conforming to RadarInAppMessageProtocol
and override the method createInAppMessageView
. Then, either pass the class conforming to RadarInAppMessageProtocol
to Radar.setInAppMessageDelegate()
class MyInAppMessageDelegate : RadarInAppMessageProtocol {
func createInAppMessageView(_ message: RadarInAppMessage, onDismiss: @escaping () -> Void, onInAppMessageClicked: @escaping () -> Void, completionHandler: @escaping (UIViewController) -> Void) { let inAppMessageViewController = myInAppMessageViewController.initialize( inAppMessage, onDismiss, onInAppMessageClicked, ) completionHandler(inAppMessageViewController) }}
#
AnalyticsAnalytics for in app messaging are available out of the box for both Android and iOS without additional setup.
#
Deep linkingThe CTA button on the in app message can be used to perform deep linking. Simply define the CTA link
field during campaign creation
Deep linking is available for both Android and iOS without any Radar specific setup. However, developer should register the scheme and handle deep linking as described in this section
#
Campaign targetingCampaigns allow you to target users based on different triggers. Note not all triggers are available for client side geofence notifications.
In order for a notification to be delivered, all targeting options must be true.
#
Geofences and Places targetingGeofence tags - allow you target groups of geofences based on their shared tags
For event based campaigns, you can target users based on their device type (iOS, Android, or both).
#
User targeting optionsToggle the show advanced button to reveal the user targeting options.
User tags can be used to target specific groups of users. Refer to the iOS or Android SDK reference for assigning tags to users. When user tag targeting is configured on a campaign, the campaign will only apply to users who have at least one of the tags targeted.
Alternatively, you can use the User ID (the external ID) based targeting to target individual users.
Geofence external IDs - allow you to target individual geofences by their unique ID
Place categories - allow you to target categories like shopping malls (shopping-mall) or restaurants (restaurant)
Place chains - allow you to target specific chains like Starbucks or Target
#
Location authorization targetingTarget users based on their device's location-authorization status. For example, you might target a campaign to only target users with foreground-location permission.
#
Specific users targetingUnder advanced options, you can find User ID (the external ID) based targeting to target individual users.
#
Beacon region targetingTarget beacons based on their tag or their beacon ID. Radar converts those targeting options and converts them into an iBeacon region under the hood to trigger notifications as users enter iBeacon regions.
You can add metadata to the campaign, which will be accessible when the notification is triggered. In iOS the metadata can be accessed from userNotificationCenter(_:didReceive response:)
with response.notification.request.content.userInfo["campaignMetadata"]
.
#
Frequency cappingRequires SDK version v3.19.6
With frequency capping, you can limit the number of notifications a user receives from a campaign. This is useful to prevent excessive notifications for users. To set up frequency capping, navigate to the campaign settings within the settings page.
From there, define the maximum number of notifications allowed in the specified time window.
The frequency cap is the maximum number of notifications allowed per user in the specified time window. This includes notifications from all campaigns.
The time window is the length of time over which the frequency cap applies. This is a rolling time window, so if the frequency cap is 2 and the time window is 48 hours, a notification could be delivered at hour 1, hour 24, and then a third at hour 49.
Additionally, at the campaign level, you can configure each campaign to ignore the global frequency capping or to set a campaign specific frequency cap (works in conjugation with the global cap).
#
Additional setup for notification based campaignClient side geofence, Event based notifications, Beacon based notifications are considered notification based campaigns. Some additional setup are required for advanced features like analytics and deep linking.
#
AnalyticsRequires SDK version v3.19.6
With Radar Conversions, you can log an event whenever a user interacts with a campaign notification.
To enable this for campaigns, make sure radarInitializationOptions.autoSetupNotificationConversion
= true
.
Refer to the iOS SDK Conversions reference or React Native Conversion references for setup instructions.
With Radar Conversions, you can also retrieve the source of an opened_app conversion for iOS apps. Within the metadata object of the logged conversion, we will return a conversion_source with either
notification
(app was opened using an external 3rd party notification)radar_notification
(app was opened using the configured on-prem notification):
You can view these campaign conversion analytics by pressing the analytics button on the campaign's page. Alternatively, you can navigate to Geofencing -> Analytics -> Events -> Filters (top right) -> select Type as opened_app -> Apply Filters. From there, select campaign_name from the grouped_by dropdown. See screenshot below:
#
Android setupNo additional setup is required for analytics for Android.
#
Automated iOS setupRadar can associate opened_app
events with a campaign notification that was clicked on to open the app. To set this up automatically, set the relevant flag on the initialization options.
- Swift
- Objective-C
import UIKitimport RadarSDK
@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let radarInitializeOptions = RadarInitializeOptions() radarInitializeOptions.autoLogNotificationConversions = true Radar.initialize(publishableKey: "prj_test_pk_...", options: radarInitializeOptions)
return true }
}
#import "AppDelegate.h"@import RadarSDK;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { RadarInitializeOptions *radarInitializeOptions = [[RadarInitializeOptions alloc] init]; radarInitializeOptions.autoLogNotificationConversions = YES; [Radar initializeWithPublishableKey:@"prj_test_pk_..." options:radarInitializeOptions];
return YES;}
@end
#
Manual iOS setupAlternatively, perform the manual setup:
- Swift
- Objective-C
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { Radar.logConversion(response: response) }
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { [Radar logConversionWithNotificationResponse:response]; completionHandler();}
#
Deep linkingRadar's campaign notifications can be used for deep linking. This means that you can use Radar's deep linking functionality to open a specific view via on premise notification taps.
Set up deep linking from the Radar's Dashboards by adding the radar:notificationURL
to the URL Schemes
of the desired navigation view of your app.
Radar campaigns use local notifications for deep linking. Due to iOS security restrictions, Universal Links opened from local notifications may redirect to Safari instead of your app. For reliable deep linking, use custom URL schemes (e.g., yourapp://) in your notification payloads.
#
Android setupRefer to the official android documentation to configure deep links for the android app. No additional Radar specific setup is required.
#
iOS setup#
AutomaticRadar's iOS SDK can automatically set up deep linking for you. To enable this feature, set the autoHandleNotificationDeepLinks
option to true
in the Radar initialize
call.
- Swift
- Objective-C
import UIKitimport RadarSDK
@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let radarInitializeOptions = RadarInitializeOptions() radarInitializeOptions.autoHandleNotificationDeepLinks = true Radar.initialize(publishableKey: "prj_test_pk_...", options: radarInitializeOptions)
return true }
}
#import "AppDelegate.h"@import RadarSDK;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { RadarInitializeOptions *radarInitializeOptions = [[RadarInitializeOptions alloc] init]; radarInitializeOptions.autoHandleNotificationDeepLinks = YES; [Radar initializeWithPublishableKey:@"prj_test_pk_..." options:radarInitializeOptions];
return YES;}
@end
It is recommended to use the automatic setup in conjugation with the RadarURLDelegate
to handle the URL open. This implementation provides the most light way approach to get started with deep linking.
#
ManualIf you want to set up deep linking manually, you can do so by adding the following line to your UNUserNotificationCenterDelegate
implementation.
- Swift
- Objective-C
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { Radar.openURLFromNotification(response.notification)}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { [Radar openURLFromNotification:response.notification]; completionHandler();}
#
React Native setup#
iOSRadar's React Native SDK can automatically set up deep linking for you. To enable this feature, set the autoHandleNotificationDeepLinks
option to true
in the radarInitializeOptions
via the AppDelegate.mm
.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.moduleName = @"main"; self.initialProps = @{}; BOOL res = [super application:application didFinishLaunchingWithOptions:launchOptions]; RadarInitializeOptions *radarInitializeOptions = [[RadarInitializeOptions alloc] init]; radarInitializeOptions.autoHandleNotificationDeepLinks = YES; [Radar nativeSetup:radarInitializeOptions]; return res;}
Alternatively perform the manual setup if you are setting the AppDelegate
as the UNUserNotificationCenterDelegate
.
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { [Radar openURLFromNotification:notification:response.notification]; completionHandler();}
#
SupportHave questions or difficulties with campaigns? Contact us at radar.com/support.