GATracker is a simple library that permit to use Google Analytics on tvOS projects
To run the example project, clone the repo, and run pod install
from the Example directory first.
- tvOS 9.0+
- Xcode 8.0+
GATracker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "GATracker"
You have simply to setup the tracker with your Google Analytics property id (eg. UA-XXXXXX-XX) preferable in app delegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
GATracker.setup("UA-XXXXXXXX-X")
return true
}
After setup you can track ScreenView or Event wherever in your application by calling these simple function from the shared instance of the GATracker
GATracker.sharedInstance.screenView(screenName: "YOUR_VIEW",
customParameters: nil)
GATracker.sharedInstance.event(category: "YOUR_CATEGORY",
action: "YOUR_ACTION",
label: "YOUR_LABEL",
customParameters: nil)
corlaonline, alex.corlatti@gmail.com
GATracker is available under the MIT license. See the LICENSE file for more info.