Skip to content

PlugForMac/SimpleGoogleAnalytics

Repository files navigation

SimpleGoogleAnalytics

SimpleGoogleAnalytics is fairly simple way to use Google Analytics on OSX. We use it for the new version of Plug.

Thanks to Coppertio's AnalyticEverything for most of the system profiling code.

Usage

Setup

let tracker = SimpleGoogleAnalytics.Manager(trackingID: "UA-XXXXXXXX-X", appBundle: NSBundle.main, userID: nil)

Pageviews

tracker.trackPageview("Main Window")

Events

tracker.trackEvent(category: "Button", action: "Click", label: "Sign In", value: nil)

Exceptions

tracker.trackException(description: "Exception", fatal: true)

Installation

Carthage

github "PlugForMac/SimpleGoogleAnalytics" ~> VERSION_NUMBER

CocoaPods

Please create an issue if you'd like CocoaPods support.