Integrating Custom Analytics

The Zappar component automatically collects and transmits anonymous usage data to the ZapWork's built in analytics system, Zapalytics. You can view this aggregated data from your ZapWorks account.

In addition to this, you may like to report information to a different analytics system used by your app, e.g. Google Analytics. The Zappar component provides a number of useful callbacks, allowing you to forward relevant events to your own system should you wish to do so.

Further to this documentation, the example project included with the Zappar embed component for iOS demonstrates use of these callbacks.

Adding the Methods

In the Integrating with your iOS app step, a protocol was added to your ViewController to provide the exit functionality for the Zappar component. You can implement further methods from that protocol to be notified of analytics events like this:

//// These optional methods can be used to send Zappar embed events
//// to your analytics system of choice, e.g. Google Analytics

-(void)zapparAnalyticsExperienceSessionDidStart:(NSString *)deepLinkId
    // Is called when an AR experience starts

-(void)zapparAnalyticsExperienceSessionDidEnd:(NSString *)deepLinkId
    // Is called when an AR experience ends

-(void)zapparAnalyticsExperienceSession:(NSString *)deepLinkId
                     didSendCustomEvent:(NSString *)eventName
    // Is called when an AR experience emits a custom event
    // These events can triggered from script within an AR experience using:
    // Z.stats.logEvent("...");

Suggested Next Steps

zapcode branded_zapcode i