This SDK has been replaced with a new version which is hosted in another repo. This SDK may no longer funciton fully. Please use the new SDK at: https://github.com/Woopra/Woopra-iOS
When the app loads, you should load the Woopra Tracker and configure it.
[WTracker sharedInstance].domain = @"mybusiness.com";
You can update your idle timeout (default: 30 seconds) by updating the timeout property in your WTracker instance:
[WTracker sharedInstance].idleTimeout = 60;
If you want to keep the user online on Woopra even if they don't commit any event between the last event and the idleTimeout, you can enable auto pings.
// Ping is disabled by default
[WTracker sharedInstance].pingEnabled = true;
To add custom visitor properties, you should edit the visitor object.
[[WTracker sharedInstance].visitor addProperty:@"name" value:@"John Smith"]
[[WTracker sharedInstance].visitor addProperty:@"email" value:@"[email protected]"]
Your custom visitor data will not be pushed until you send your first custom event. On website, the default event is a pageview
. In mobile apps, we recommend that developers use the event appview
when switching between Windows and Views.
To add send an appview
event:
// create event "appview"
WEvent* event = [WEvent eventWithName:@"appview"];
// add property "view" with value "login-view"
[event addProperty:@"view": value:@"login-view"];
// track event
[[WTracker sharedInstance] trackEvent:event];