-
Notifications
You must be signed in to change notification settings - Fork 31
Kenny/ Campaign docs revamp #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5f9b201
18ea6cc
096d51f
421b504
12b2800
67d0ee4
dd825df
4fd2bf9
ae7ab46
0a2a97b
aa844e3
8d0fed6
b8ae799
facd46c
5b42e96
52b78e5
01b44b6
4a6c431
e312c7d
d977d1d
ba8cb3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,61 +22,227 @@ First, [sign up](https://radar.com/signup) for Radar and get an API key. | |
|
||
To use campaigns with geofences, start by [creating geofences](/geofences#create-geofences) through the dashboard, a CSV import, or the API. | ||
|
||
To use campaigns with places, ensure that places are enabled through the [settings page](https://radar.com/dashboard/settings) 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](https://radar.com/dashboard/settings). | ||
To use campaigns with places, ensure that places are enabled through the [settings page](https://radar.com/dashboard/settings) 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](https://radar.com/dashboard/settings). | ||
|
||
To use campaigns with events, ensure that the desired trigger events are enabled through the [settings page](https://radar.com/dashboard/settings). | ||
|
||
To use campaigns with beacons, ensure that the beacons are created and enabled through the [beacons page](https://radar.com/geofencing/beacons) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's link to the docs instead: https://docs.radar.com/beacons |
||
|
||
Once set up, [create your campaigns](/campaigns#create-campaigns) using the dashboard. | ||
|
||
## Create campaigns | ||
|
||
To create a campaign via the dashboard, navigate to the [campaigns page](https://radar.com/dashboard/geofencing/campaigns) and click **Create**. Provide the campaign's name, notification body, and targeting details. You can target users using either geofences or places. | ||
To create a campaign via the dashboard, navigate to the [campaigns page](https://radar.com/dashboard/geofencing/campaigns) 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 | ||
### Client side geofence (iOS only) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we want a section "Client-side notifications (iOS only)" with subsections for geofence/place and then for beacon based |
||
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 <b>"when in use"</b> permissions, dramatically improving their reachable audience. | ||
|
||
Radar's client side geofence notifications make use of location notification triggers on iOS. These triggers work with foreground or <b>"when in use"</b> permissions. No location data is collected in the background. | ||
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. | ||
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](https://developer.apple.com/documentation/usernotifications/unlocationnotificationtrigger#overview) that iOS enforces. | ||
|
||
<Alert alertType="info"> | ||
If the device is already inside the geofence when its client-side geofence notification is being synced, it will fire upon subsequent entry, not immediately. | ||
</Alert> | ||
|
||
## Targeting options | ||
|
||
### Event based notifications | ||
|
||
Event 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clientside beacon are ios only and belong above. but there's beacon event notifications that fit here |
||
|
||
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 <b>"when in use"</b> 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 messaging | ||
|
||
In 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 | ||
Comment on lines
+68
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You say "no additional code is required" and then present a bunch of code snippets. Give an intro to life cycle hooks and when someone would want to use them |
||
|
||
##### iOS | ||
|
||
``` swift | ||
class MyRadarInAppMessageDelegate : NSObject, RadarInAppMessageProtocol { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be class MyRadarInAppMessageDelegate : RadarInAppMessageDelegate {
// Called when the CTA button is clicked by the user. Default behavior open configured deeplink, override to implement custom behavior
override func onInAppMessageButtonClicked(_ message: RadarInAppMessage) {
...
}
// Called when the dismiss button is clicked by the user. Override to implement custom behavior
override 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
override func onNewInAppMessage(_ message: RadarInAppMessage) -> RadarInAppMessageOperation {
...
}
// Called to create the in-app message view. Default behavior creates a view defined by Radar, override to create a custom view. (note: if a custom view is used, the dashboard preview will not be accurate)
override func createInAppMessageView(_ message: RadarInAppMessage, onDismiss: @escaping () -> Void, onInAppMessageClicked: @escaping () -> Void, completionHandler: @escaping (UIViewController) -> Void) {
...
completionHandler(viewController)
}
} and we can probably make this a code tab, and include ObjC as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ObjC:
|
||
|
||
// 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 { | ||
... | ||
} | ||
} | ||
``` | ||
|
||
##### Android | ||
|
||
``` kotlin | ||
class 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 messages | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Custom styling"? |
||
|
||
The 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. | ||
|
||
##### Android | ||
|
||
Implement 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()` | ||
|
||
``` kotlin | ||
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) | ||
} | ||
} | ||
|
||
``` | ||
|
||
##### iOS | ||
|
||
Implement 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()` | ||
|
||
``` swift | ||
class MyInAppMessageDelegate : RadarInAppMessageProtocol { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should inherit from |
||
|
||
func createInAppMessageView(_ message: RadarInAppMessage, onDismiss: @escaping () -> Void, onInAppMessageClicked: @escaping () -> Void, completionHandler: @escaping (UIViewController) -> Void) { | ||
let inAppMessageViewController = myInAppMessageViewController.initialize( | ||
inAppMessage, | ||
onDismiss, | ||
onInAppMessageClicked, | ||
) | ||
completionHandler(inAppMessageViewController) | ||
} | ||
} | ||
|
||
``` | ||
|
||
|
||
#### Analytics | ||
|
||
Analytics for in app messaging are available out of the box for both Android and iOS without additional setup. | ||
|
||
#### Deep linking | ||
|
||
The 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](#deep-linking-1) | ||
|
||
## Campaign targeting | ||
|
||
Campaigns allow you to target users based on different triggers. Note not all triggers are available for client side geofence notifications. | ||
|
||
Campaign triggers either target geofences or places. Geofences should be targeted using geofence tags or IDs, while places should be targeted by categories or chains. Targeting applies to a user event when all targeting options are true. | ||
*In order for a notification to be delivered, all targeting options must be true.* | ||
|
||
You can also target users based on their location-authorization status. For example, you might target a campaign to only target users with foreground-location permission. | ||
### Geofences and Places targeting | ||
|
||
**Geofence 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 options | ||
|
||
Toggle 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](/sdk/ios#user-tags) or [Android](/sdk/android#user-tags) 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](/sdk/ios#identify-user)) 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 targeting | ||
|
||
Target 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 targeting | ||
|
||
Under advanced options, you can find User ID (the [external ID](/sdk/ios#identify-user)) based targeting to target individual users. | ||
|
||
## Notification configurations | ||
### Beacon region targeting | ||
|
||
You can configure the notifications Radar sends to users when they enter a geofence or place. Customize the notification body, and optionally, the notification title and the deep link URL. | ||
Target 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 capping | ||
|
||
*Requires 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 [setting page](https://radar.com/dashboard/settings). | ||
Under the campaigns section, define the maximum number of notifications allowed in the specified time window. | ||
To set up frequency capping, navigate to the [campaign settings](https://radar.com/dashboard/settings#campaigns-settings) within the settings page. | ||
|
||
The SDK will only sync up to the frequency cap number of notifications. As such, we'd recommend setting a cap of 2 notifications for a time window of 48 hours instead of 1 notification for 24 hours. | ||
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**. | ||
|
||
## Analytics (iOS only) | ||
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 campaign | ||
|
||
Client 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. | ||
|
||
### Analytics | ||
|
||
*Requires SDK version v3.19.6* | ||
|
||
With Radar [Conversions](/api#log-a-conversion), 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](/sdk/ios#conversions) or [React Native Conversion references](/sdk/react-native#conversions) for setup instructions. | ||
|
||
With Radar [Conversions](/api#log-a-conversion), you can also retrieve the source of an *opened_app* conversion for iOS apps. Within the *metadata* object of the [logged conversion](/sdk/ios#conversions), we will return a *conversion_source* with either | ||
- **`notification`** (app was opened using an external 3rd party notification) | ||
|
@@ -85,7 +251,11 @@ With Radar [Conversions](/api#log-a-conversion), you can also retrieve the sourc | |
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: | ||
 | ||
|
||
### Automated iOS setup | ||
#### Android setup | ||
|
||
No additional setup is required for analytics for Android. | ||
|
||
#### Automated iOS setup | ||
|
||
Radar 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. | ||
|
||
|
@@ -139,7 +309,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
</TabItem> | ||
</Tabs> | ||
|
||
### Manual iOS setup | ||
#### Manual iOS setup | ||
|
||
Alternatively, perform the manual setup: | ||
|
||
|
@@ -171,13 +341,21 @@ func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive respo | |
</TabItem> | ||
</Tabs> | ||
|
||
## Deep linking (iOS only) | ||
### Deep linking | ||
|
||
Radar's client side geofence 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. | ||
Radar'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. | ||
|
||
### Automated iOS setup | ||
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 setup | ||
|
||
Refer to the [official android documentation](https://developer.android.com/training/app-links/deep-linking) to configure deep links for the android app. No additional Radar specific setup is required. | ||
|
||
#### iOS setup | ||
|
||
##### Automatic | ||
|
||
Radar'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. | ||
|
||
|
@@ -233,7 +411,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
|
||
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. | ||
|
||
### Manual iOS setup | ||
##### Manual | ||
|
||
If you want to set up deep linking manually, you can do so by adding the following line to your `UNUserNotificationCenterDelegate` implementation. | ||
|
||
|
@@ -265,29 +443,33 @@ func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive respo | |
</TabItem> | ||
</Tabs> | ||
|
||
### Automated React Native setup (iOS only) | ||
|
||
#### React Native setup | ||
|
||
##### iOS | ||
|
||
Radar'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`. | ||
```Objective-C | ||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
{ | ||
self.moduleName = @"main"; | ||
self.initialProps = @{}; | ||
|
||
BOOL res = [super application:application didFinishLaunchingWithOptions:launchOptions]; | ||
KennyHuRadar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
RadarInitializeOptions *radarInitializeOptions = [[RadarInitializeOptions alloc] init]; | ||
radarInitializeOptions.autoHandleNotificationDeepLinks = YES; | ||
[Radar nativeSetup:radarInitializeOptions]; | ||
return res; | ||
} | ||
``` | ||
### Handle system deep link | ||
|
||
Opening the notification will result in the SDK calling `[application openURL:url options:@{} completionHandler:nil];` This will open the URL in the app if it is registered for the scheme, or open the URL in the browser if it is not. | ||
Developers should handle this by handling the [custom URL scheme](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app) or [universal link](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app) in their app. | ||
React Native developers should also implement the native iOS handling of the deep link in their app. | ||
|
||
Alternatively perform the manual setup if you are setting the `AppDelegate` as the `UNUserNotificationCenterDelegate`. | ||
|
||
```objc | ||
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { | ||
[Radar openURLFromNotification:notification:response.notification]; | ||
completionHandler(); | ||
} | ||
``` | ||
## Support | ||
|
||
Have questions or difficulties with campaigns? Contact us at [radar.com/support](https://radar.com/support). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we changing this to code snippets?