Skip to main content
Conversions are available on the Enterprise plan.
In this tutorial, we show you how to use Radar’s conversions API to analyze the location context associated with key customer interactions. Conversions can represent anything from a purchase or signup to engagement with an in-app feature. When these events are enriched with Radar’s location context, they can be used to determine where these conversions occur and measure the value of location based features.

Languages used

  • Swift
  • Kotlin

Features used

Steps

1

Sign up for Radar

If you haven’t already, sign up for Radar to get your API key. You can create up to 1,000 geofences and make up to 100,000 API requests per month for free.Get API keys
2

Install the Radar SDK

iOS

If you’re starting from scratch, create a new Xcode project of type Single View App.Install the iOS SDK using CocoaPods or Carthage (recommended) or by downloading the framework and dragging it into your project.Initialize the SDK in your AppDelegate class with your publishable API key.
import UIKit
import RadarSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Radar.initialize(publishableKey: "prj_test_pk_...")

        return true
    }

}

Android

The best way to add the SDK to your project is via Gradle. See the Android SDK installation guide.When your app starts, in application onCreate(), initialize the SDK with your publishable API key.
import io.radar.sdk.Radar

class MyApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        Radar.initialize(this, "prj_test_pk_...")
    }

}
3

Determine the conversions you want to track

To take advantage of Radar’s conversions API, you need to identify the events that are important to your business. Here are some examples:
Conversion nameExample purposePlacementEvent properties
purchaseMeasure the revenue driven from location-enabled featuresAfter a user makes a purchaserevenue (number)
pickup (boolean)
in_store_mode (boolean)
order_placedUnderstand where users are placing orders within the app to prioritize personalized featuresAfter a user places an orderrevenue (number)
applied_coupon (boolean)
sign_upMeasure which stores are driving sign ups through store promotionsAfter a user completes the signup flowreferrer (string)
rewards (boolean)
product_searchUnderstand where customers are searching for products (i.e., in specific stores or at competitor locations)After a user searches for a productsection (string)
4

Set up Radar geofences or places

On the Geofences page, import geofences for your locations. For places, on the Settings page, monitor your desired place chains and categories. When processing conversions, Radar will determine if they happen at any of these geofences or places.
5

Log conversions via the Radar SDK

The following example demonstrates how to log a conversion when a user makes a purchase.
// on making a purchase
Radar.logConversion(
  name: "purchase",
  revenue: 12.50,
  metadata: ["product":"shirt"]
) { (status, event) in
  print("Logged conversion: status = \(Radar.stringForStatus(status)); event = \(String(describing: event))")
}
6

Conversions overview in the Radar dashboard

The Report page of the Radar dashboard has a Conversions tab that provides an overview of all conversions logged for a project. Understand how engagement with your app differs between opted-in and opted-out users. See the total revenue across all conversions that have been logged with revenue.Below is an example of a fully populated Conversions page for a project that has logged conversions for purchase and opened_notification events:Conversions Report Page 0b467fbf731440f46fab841b3ebcee68 Pn
7

Analyze conversions across location context types

You can see when and where conversions were generated directly in the Radar dashboard. On the Events page, watch as conversions start to stream in:Conversion Events Feed 61fa7247b3e1dc0a1b91a4492f3d7687 PnClick the_View icon_ on the right to view a conversion’s details:Conversion Event Detail Page GiFinally, select Analysis within the dropdown on the Events page to view all of your conversions sliced by different dimensions, such as place chain or geofence tag:Conversion Events Analysis 0252a5def813edf16b7ac1c4ce50ff80 Pn