For the complete documentation index, see llms.txt. This page is also available as Markdown.

Piano Analytics

The Piano Analytics dispatcher automatically dispatches events to the Piano SDK, including AT tags when they are available.

https://github.com/BatchLabs/Batch-iOS-piano-dispatcher.git
Podfile
pod 'BatchPianoDispatcher'
Cartfile
github "BatchLabs/Batch-iOS-piano-dispatcher"

By default the dispatcher will handle UTM tracking and will send events only as Piano On-site Ads events.

Register the dispatcher and update the configuration as following:

@import BatchPianoDispatcher

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    let pianoDispatcher = BatchPianoDispatcher.instance
    
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        // PA Configuration
        pa.setConfiguration(ConfigurationBuilder()
            .withCollectDomain("logsx.xiti.com")
            .withSite(123456789)
            .build()
        )
        // Uncomment if you want to enable custom event sending (default: false)
        //pianoDispatcher.enableCustomEvents = true

        // Uncomment if you want to disable On-Site Ads event sending (default: true)
        //pianoDispatcher.enableOnSiteAdsEvents = false

        // Uncomment if you want to disable UTM tracking (default: true)
        //pianoDispatcher.enableUTMTracking = false
        
        BatchEventDispatcher.add(pianoDispatcher)
        
        [...]

        BatchSDK.start(withAPIKey: "YOUR_API_KEY")
        return true
    }
}

If you enable custom events, you also need to define them in your Piano Data Model. If so, please refer to the custom event/property list.

Last updated