Data Integrations and Customization

Tracking Rover Screen Views

Screen views in Rover experiences are tracked into Rover's own analytics features, but if you want to track them in your own analytics tools, you can do so by using registering a callback with the Rover SDK.


Registering a Screen View Callback

The registerScreenViewedCallback method on the Rover SDK singleton allows you to register a callback to be fired whenever an experience screen is viewed. The callback is given a single parameter, a value type with properties giving details about the experience and the screen.

iOS

// Add a screen viewed callback handler:
Rover.shared.registerScreenViewedCallback { event in
    // track screen view event into your own analytics tools here.
    // a common pattern for naming screens in many is to indicate hierarchy with slashes.  We'll
    // create a screen name out of the experience's name and screen name, if provided.
    let screenName = "\(event.experienceName ?? "Experience") / \(event.screenName ?? "Screen")"
    os_log("Rover experience screen viewed: %s", type: .default, screenName)
    
    // MyAnalyticsSDK.trackScreen(screenName)
}

Android

// You can wire up a callback to be informed of Experience screen views, for example
// for tracking events into another analytics tool:
Rover.shared.registerScreenViewedCallback { screenViewed ->
    // track screen view event into your own analytics tools here.
    // a common pattern for naming screens in many is to indicate hierarchy with slashes.  We'll
    // create a screen name out of the experience's name and screen name, if provided.
    val screenName = "${screenViewed.experienceName ?: "Experience"} / ${screenViewed.screenName ?: "Screen"}"

    Log.e("RoverExampleApplication", "Rover experience screen viewed: $screenName")

    // MyAnalyticsSDK.trackScreen(screenName)
}

Callback Parameter

On both platforms, your callback is given a single parameter, a value type. Here are the properties:

  • experienceId: the id of the Rover experience itself.
  • experienceName: the name of the Rover experience itself.
  • screenName : the name given to the screen being presented in the Rover experience.
  • screenId : the id of the screen being presented in the Rover experience.
  • screenProperties : metadata properties associated with the presented screen.
  • screenTags : metadata tags associated with the presented screen.
  • campaignId: the id of the campaign associated with this experience. This is typically used for analytics purposes.
  • data: JSON data from a Web API data source. Not applicable to classic experiences.
  • urlParameters: URL query parameters included with the URL that launched the experience. Not applicable to classic experiences.
Previous
SeatGeek