Data Integrations and Customization
Ticketmaster Integration
Rover includes support for integrating with the Ticketmaster Ingite SDK. This will allow your team to surface some Ticketmaster information within the Rover Audience and Campaigns tools.
The integration is indirect; you integrate both the Ignite SDK and the Rover SDK into your app, and write a little bit of glue code.
Installing the Module
iOS
First, be sure that the "RoverTicketmaster" package product module has been selected from the SwiftPM package (review the Install page for details). The RoverTicketmaster module has dependencies on the TicketmasterDiscoveryAPI and TicketmasterPurchase modules of the Ticketmaster Ignite SDK, which will be added by the SPM automatically.
Then you need to configure a TMAuthenticationDelegate
in your view controller hosting the Ingite SDK (as described in the Ingite SDK documentation), and then from there you'll call methods on Rover's TicketmasterAuthorizer
object to keep Rover up to date on Ticketmasterlogins.
First, set the user's Ticketmaster credentials into Rover after a successful sign-in with the Ingite SDK. Implement the onMemberUpdated(backend:state:error:)
method in the delegate, check for the .loginCompleted
state and call setTicketmasterID
method and passing in the user's TM ID from the TMAuthentication.shared.memberInfo
.
extension MyViewController: TMAuthenticationDelegate {
func onStateChanged(
backend: TMAuthentication.BackendService?,
state: TMAuthentication.ServiceState,
error: (Error)?) {
// ...
switch state {
// ...
case .loginCompleted:
TMAuthentication.shared.memberInfo { memberInfo in
Rover.sharedticketmasterAuthorizer.setTicketmasterID(memberInfo.localID)
} failure: { oldMemberInfo, error, backend in
print("MemberInfo Error: \(error.localizedDescription)")
}
}
}
}
Then clear the user's Ticketmaster credentials after a successful sign-out with the Ingite SDK documentation. Implement the onMemberUpdated(backend:state:error:)
method in the delegate, check for the .loggedOut
state and call clearCredentials
method.
extension MyViewController: TMAuthenticationDelegate {
//...
func onStateChanged(
backend: TMAuthentication.BackendService?,
state: TMAuthentication.ServiceState,
error: Error?
) {
// ...
switch state {
// ...
case .loggedOut:
Rover.shared.ticketmasterAuthorizer.clearCredentials()
}
}
}
In order to capture Ticket Selection and Purchase events, you need to setup a TMPurchaseUserAnalyticsDelegate
in your view controller hosting the Ignite SDK (as described in the Ignite SDK documentation), and then from there you'll call methods on Rover's TicketmasterAnalytics
object to keep Rover up to date on Ticketmaster events.
extension MyViewController: TMPurchaseUserAnalyticsDelegate {
//...
func userDidPerform(
action: TMTickets.Analytics.Action,
metadata: TMTickets.Analytics.MetadataType
) {
Rover.shared.ticketmasterAnalytics.postTicketmasterAction(
action: action,
metadata: metadata
)
}
func userDidView(
page: TMTickets.Analytics.Page,
metadata: TMTickets.Analytics.MetadataType
) {
Rover.shared.ticketmasterAnalytics.postTicketmasterEvent(
page: page,
metadata: metadata
)
}
func purchaseNavigationController(
_ purchaseNavigationController: TMPurchaseNavigationController,
didBeginCheckoutFor event: DiscoveryEvent
) {
Rover.shared.ticketmasterAnalytics.didBeginCheckout(for: event)
}
func purchaseNavigationController(
_ purchaseNavigationController: TMPurchaseNavigationController,
didEndCheckoutFor event: DiscoveryEvent,
because reason: TMEndCheckoutReason
) {
Rover.shared.ticketmasterAnalytics.didEndCheckout(for: event, because: reason)
}
func purchaseNavigationController(
_ purchaseNavigationController: TMPurchaseNavigationController,
didBeginTicketSelectionFor event: DiscoveryEvent
) {
Rover.shared.ticketmasterAnalytics.didBeginTicketSelection(for: event)
}
func purchaseNavigationController(
_ purchaseNavigationController: TMPurchaseNavigationController,
didEndTicketSelectionFor event: DiscoveryEvent,
because reason: TMEndTicketSelectionReason
) {
Rover.shared.ticketmasterAnalytics.didEndTicketSelection(for: event, because: reason)
}
}
Android
Add the Rover Ticketmaster module to your Gradle dependencies:
implementation "io.rover.sdk:ticketmaster:4.7.0"
Initialize the TicketmasterAssembler
:
Rover.initialize(
...,
TicketmasterAssembler(),
...
)
Then you need to implement the PresenceLoginListener
interface in an Activity, have the TmxLoginNotifier
instance register the login listener and then from there use methods on Rover's TicketmasterAuthorizer
object to keep Rover up to date on Ticketmaster logins.
First, set the user's Ticketmaster credentials into Rover after a successful sign-in with the Ignite SDK. Implement the onMemberUpdated(backendName: TMLoginApi.BackendName, member: UserInfoManager.MemberInfo?)
method and call the setTicketmasterId
method passing in the user's TM ID from the MemberInfo
object.
fun setupAnalytics() {
TmxLoginNotifier.getInstance().registerLoginListener(this)
}
override fun onMemberUpdated(backendName: TMLoginApi.BackendName, member: UserInfoManager.MemberInfo?) {
member?.let {
Rover.shared.ticketmasterAuthorizer.setTicketmasterId(
member.getGlobalId()
)
}
}
Then clear the user's Ticketmaster credentials after a successful sign-out with the Ignite SDK. Implement the onLogoutSuccessful()
method and call the clearCredentials
method.
fun setupAnalytics() {
TmxLoginNotifier.getInstance().registerLoginListener(this)
}
override fun onLogoutSuccessful(backendName: TMLoginApi.BackendName) {
Rover.shared.ticketmasterAuthorizer.clearCredentials()
}
In order to capture Ticket Selection and Purchase events, you need to setup a TMPurchaseUserAnalyticsListener
when setting up an TMPurchaseFragmentFactory
, with the Ignite SDK (as described in the Ignite SDK documentation), and then from there you'll call methods on Rover's TicketmasterAnalytics
object to keep Rover up to date on Ticketmaster events.
class MyActivity : AppCompatActivity(), TMPurchaseUserAnalyticsListener {
//...
override fun onTicketSelectionStarted(event: DiscoveryEvent) {
Rover.shared.ticketmasterAnalytics.onTicketSelectionStarted(event)
}
override fun onTicketSelectionFinished(event: DiscoveryEvent, reason: TMTicketSelectionEndReason) {
Rover.shared.ticketmasterAnalytics.onTicketSelectionFinished(event, reason)
}
override fun onCheckoutStarted(event: DiscoveryEvent) {
Rover.shared.ticketmasterAnalytics.onCheckoutStarted(event)
}
override fun onCheckoutFinished(event: DiscoveryEvent, reason: TMCheckoutEndReason) {
Rover.shared.ticketmasterAnalytics.onCheckoutFinished(event, reason)
}
}
Other Ticketmaster events can be captured by observing the UserAnalyticsDelegate
LiveData
and posting the event to the Rover SDK.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//...
UserAnalyticsDelegate.handler.getLiveData().observeForever(userAnalyticsObserver)
}
private val userAnalyticsObserver = Observer<UserAnalyticsDelegate.AnalyticsData?> {
it?.let {
//Post the event to the Rover SDK
Rover.ticketmasterAnalytics.postTicketmasterEvent(it.actionName, it.data)
}
}