Analytics
The Rover SDK offers you a stream of events informing you of user interactions with Rover. This may be of particular use for integrating with your analytics or marketing automation solutions. The Rover Android SDK offers you two separate methods for receiving these events.
Rx Observable
There is a Reactive Streams Publisher, readily convertable into an RxJava 2 Observable, that will give you a subscribable stream of the events. Receive them with:
// Convert the Rover SDK publisher into an RxJava observable:
val observable = Observable.fromPublisher(
Rover.shared?.eventEmitter?.trackedEvents!!
)
// Subscribe to the Rover events. Be sure to manage the lifecycle and the Disposable as necessary for your subscriber:
observable
.subscribe { roverEvent: RoverEvent ->
val eventName = roverEvent.eventAction.action // such as `io.rover.ExperienceViewed`
val attributes: Map<String, Any> = roverEvent.attributes // a hashmap of the event attributes, see the above documentation
Log.d("MyApp", "Rover event '${eventName}'")
}
Listener Object
In lieu of using Rx, you can register a callback object (akin to the listener object pattern frequently used in Android’s view layer) to receive the events:
Rover.shared?.eventEmitter?.addEventListener(object : RoverEventListener {
override fun onExperienceDismissed(event: RoverEvent.ExperienceDismissed) {
}
override fun onExperienceViewed(event: RoverEvent.ExperienceViewed) {
}
override fun onScreenPresented(event: RoverEvent.ScreenPresented) {
}
override fun onScreenDismissed(event: RoverEvent.ScreenDismissed) {
}
override fun onScreenViewed(event: RoverEvent.ScreenViewed) {
}
override fun onBlockTapped(event: RoverEvent.BlockTapped) {
}
override fun onPollAnswered(event: RoverEvent.PollAnswered)
}
Supported Events
Experienced Presented
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
Experience Dismissed
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
Experience Viewed
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
event.duration | Int | The amount of time, in seconds, the user spent viewing the Experience. |
Screen Presented
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
event.screen.id | String | Unique identifier for this screen. |
event.screen.tags | [String] | Tags set on the Screen in the Experiences authoring app. |
event.screen.keys | Object | Custom key value pairs set on the Screen in the Experiences authoring app. |
event.screen.name | String | The screen’s name, set in the Experiences authoring app. |
Screen Dismissed
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
event.screen.id | String | Unique identifier for this screen. |
event.screen.tags | [String] | Tags set on the Screen in the Experiences authoring app. |
event.screen.keys | Object | Custom key value pairs set on the Screen in the Experiences authoring app. |
event.screen.name | String | The screen’s name, set in the Experiences authoring app. |
Screen Viewed
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
event.screen.id | String | Unique identifier for this screen. |
event.screen.tags | [String] | Tags set on the Screen in the Experiences authoring app. |
event.screen.keys | Object | Custom key value pairs set on the Screen in the Experiences authoring app. |
event.screen.name | String | The screen’s name, set in the Experiences authoring app. |
event.duration | Int | The amount of time, in seconds, the user spent viewing the screen in the Experience. |
Block Tapped
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
event.screen.id | String | Unique identifier for this screen. |
event.screen.tags | [String] | Tags set on the Screen in the Experiences authoring app. |
event.screen.keys | Object | Custom key value pairs set on the Screen in the Experiences authoring app. |
event.screen.name | String | The screen’s name, set in the Experiences authoring app. |
event.row.id | String | Unique identifier for this row. |
event.row.tags | [String] | Tags set on the row in the Experiences authoring app. |
event.row.keys | Object | Custom key value pairs set on the row in the Experiences authoring app. |
event.row.name | String | The row’s name, set in the Experiences authoring app. |
event.block.id | String | Unique identifier for this block. |
event.block.tags | [String] | Tags set on the Block in the Experiences authoring app. |
event.block.keys | Object | Custom key value pairs set on the block in the Experiences authoring app. |
event.block.name | String | The block’s name, set in the Experiences authoring app. |
Poll Answered
Column | Type | Description |
---|---|---|
event.campaignId | String? | The optional “Campaign ID” you set with RoverActivity.makeIntent(). |
event.experience.id | String | The unique identifier for this experience. |
event.experience.tags | [String] | Tags set on the Experience in the Experiences authoring app. |
event.experience.keys | Object | Custom key value pairs set in the Experiences authoring app. |
event.experience.name | String | The experience’s name, set in the Experiences authoring app. |
event.screen.id | String | Unique identifier for this screen. |
event.screen.tags | [String] | Tags set on the Screen in the Experiences authoring app. |
event.screen.keys | Object | Custom key value pairs set on the Screen in the Experiences authoring app. |
event.screen.name | String | The screen’s name, set in the Experiences authoring app. |
event.block.id | String | Unique identifier for this block. |
event.block.tags | [String] | Tags set on the Block in the Experiences authoring app. |
event.block.keys | Object | Custom key value pairs set on the block in the Experiences authoring app. |
event.block.name | String | The block’s name, set in the Experiences authoring app. |
event.poll.id | String | The unique identifier of the poll. |
event.poll.text | String | The question text of the poll. |
event.option.id | String | The unique identifier of the chosen poll option. |
event.option.text | String | The text of the chosen poll option. |
event.option.image | String? | The image url of the chosen poll option, only non-null for image polls. |