Last active
May 18, 2018 14:44
-
-
Save matiasvillaverde/827d7ee1047029d95094b3776f76ab86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import GoogleAnalytics | |
class GoogleAnalytics: Analytics { | |
func setup() { | |
GAI.sharedInstance().tracker(withTrackingId: "UA-123456789-1") | |
} | |
func track(event: String) { | |
// Common you are google... this is not a nice way to design an API. | |
guard let tracker = GAI.sharedInstance().defaultTracker else { return } | |
let toSend = GAIDictionaryBuilder.createEvent(withCategory: event, | |
action: nil, | |
label: nil, | |
value: nil).build() as [NSObject: AnyObject] | |
tracker.send(toSend) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment