/Woopra-iOS

Primary LanguageSwiftMIT LicenseMIT

Woopra iOS SDK Documentation

When the app loads, you should load the Woopra Tracker and configure it.

WTracker.shared.domain = "mybusiness.com"

You can update your idle timeout (default: 60 seconds) by updating the timeout property in your WTracker instance:

WTracker.shared.idleTimeout = 30

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.shared.pingEnabled = true

To add custom visitor properties, you should edit the visitor object.

WTracker.shared.visitor.add(property: "name", value: "John Smith")
WTracker.shared.visitor.add(property: "email", value: "john@smith.com")

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"
let event = WEvent.event(name: "appview")
// add property "view" with value "login-view"
event.add(property: "view", value: "login-view")
// track event
WTracker.shared.trackEvent(event)

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate WoopraSDK into your Xcode project using CocoaPods, please, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Woopra-iOS'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Woopra iOS SDK into your Xcode project using Carthage, specify it in your Cartfile:

github "Woopra/Woopra-iOS"

Run carthage update to build the framework and drag the built WoopraSDK.framework into your Xcode project.