From 2ff8dbc3486eb4f3685fa019aea67541e407c580 Mon Sep 17 00:00:00 2001 From: Jerry Tian Date: Mon, 25 Mar 2013 16:05:48 +0800 Subject: [PATCH 1/7] adding new tracking API from Google Analytics. --- .../Classes/AnalyticsHelper.h | 4 ++ .../Classes/AnalyticsHelper.m | 48 ++++++++++++++++++- .../Classes/GoogleTracking.m | 7 ++- .../project.pbxproj | 10 +++- 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h index d8574e7..719ee28 100644 --- a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h +++ b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h @@ -6,10 +6,14 @@ // http://github.com/noahsw/google-analytics-sdk-for-osx // +#define GANALYTICS_DOMAIN @"voyagerapps.com" @interface AnalyticsHelper : NSObject +(BOOL) fireEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue; ++(BOOL) mearsureEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue; + + @end diff --git a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m index a5273de..d1946ff 100644 --- a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m +++ b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m @@ -13,6 +13,8 @@ #import "TrackingRequest.h" #import "RequestFactory.h" +#import "GoogleUniversalTracking.h" + #import "DDLog.h" static const int ddLogLevel = LOG_LEVEL_VERBOSE | LOG_LEVEL_INFO | LOG_LEVEL_ERROR | LOG_LEVEL_WARN; @@ -45,7 +47,7 @@ +(BOOL) fireEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue DDLogInfo(@"%@, %@, %@, %@", eventCategory, eventAction, eventLabel, eventValue); - GoogleEvent* googleEvent = [[GoogleEvent alloc] initWithParams:@"highlighthunter.com" category:eventCategory action:eventAction label:eventLabel value:eventValue]; + GoogleEvent* googleEvent = [[GoogleEvent alloc] initWithParams:GANALYTICS_DOMAIN category:eventCategory action:eventAction label:eventLabel value:eventValue]; if (googleEvent != nil) @@ -70,7 +72,51 @@ +(BOOL) fireEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue } ++(BOOL) mearsureEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue { + NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary]; + NSString* eventCategory = [NSString stringWithFormat:@"Mac %@", infoDict[@"CFBundleShortVersionString"]]; + + NSString* eventLabel = @"empty"; + NSUserDefaults* standardUserDefaults = [NSUserDefaults standardUserDefaults]; + if (standardUserDefaults) + { + NSString* userUUID = [standardUserDefaults stringForKey:@"UserUUID"]; + if ([userUUID length] == 0) + { // generate one for the first time + userUUID = [self UUIDString]; + [standardUserDefaults setObject:userUUID forKey:@"UserUUID"]; + [standardUserDefaults synchronize]; + } + + eventLabel = userUUID; + } + + DDLogInfo(@"%@, %@, %@, %@", eventCategory, eventAction, eventLabel, eventValue); + + GoogleEvent* googleEvent = [[GoogleEvent alloc] initWithParams:GANALYTICS_DOMAIN category:eventCategory action:eventAction label:eventLabel value:eventValue]; + + + if (googleEvent != nil) + { + RequestFactory* requestFactory = [RequestFactory new]; + TrackingRequest* request = [requestFactory buildRequest:googleEvent]; + + if (operationQueue == nil) + { + operationQueue = [NSOperationQueue new]; + operationQueue.maxConcurrentOperationCount = 1; + } + + GoogleUniversalTracking* trackingOperation = [GoogleUniversalTracking new]; + trackingOperation.request = request; + + [operationQueue addOperation:trackingOperation]; + + } + + return YES; +} +(NSString*)UUIDString { diff --git a/Google Analytics SDK for OSX/Classes/GoogleTracking.m b/Google Analytics SDK for OSX/Classes/GoogleTracking.m index c268ce7..d26e948 100644 --- a/Google Analytics SDK for OSX/Classes/GoogleTracking.m +++ b/Google Analytics SDK for OSX/Classes/GoogleTracking.m @@ -30,10 +30,13 @@ - (id)init return self; } - - - (void)main { + if (![NSThread isMainThread]) { + [self performSelectorOnMainThread:@selector(main) withObject:nil waitUntilDone:NO]; + return; + } + [NSThread setThreadPriority:0.1]; [NSThread sleepForTimeInterval:1]; diff --git a/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj b/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj index 8120c12..57840bf 100644 --- a/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj +++ b/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + C469A05F170011780085BB41 /* GoogleUniversalTracking.h in Headers */ = {isa = PBXBuildFile; fileRef = C469A05D170011780085BB41 /* GoogleUniversalTracking.h */; }; + C469A060170011780085BB41 /* GoogleUniversalTracking.m in Sources */ = {isa = PBXBuildFile; fileRef = C469A05E170011780085BB41 /* GoogleUniversalTracking.m */; }; CE42F10B166AE7FE005AE3D4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE42F10A166AE7FE005AE3D4 /* Cocoa.framework */; }; CE42F115166AE7FE005AE3D4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE42F113166AE7FE005AE3D4 /* InfoPlist.strings */; }; CE42F121166AE7FE005AE3D4 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE42F120166AE7FE005AE3D4 /* SenTestingKit.framework */; }; @@ -14,7 +16,7 @@ CE42F125166AE7FE005AE3D4 /* Google Analytics SDK for OSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE42F107166AE7FE005AE3D4 /* Google Analytics SDK for OSX.framework */; }; CE42F12B166AE7FE005AE3D4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE42F129166AE7FE005AE3D4 /* InfoPlist.strings */; }; CE42F12E166AE7FF005AE3D4 /* Google_Analytics_SDK_for_OSXTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CE42F12D166AE7FF005AE3D4 /* Google_Analytics_SDK_for_OSXTests.m */; }; - CE42F145166AE977005AE3D4 /* AnalyticsHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = CE42F137166AE976005AE3D4 /* AnalyticsHelper.h */; }; + CE42F145166AE977005AE3D4 /* AnalyticsHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = CE42F137166AE976005AE3D4 /* AnalyticsHelper.h */; settings = {ATTRIBUTES = (Public, ); }; }; CE42F146166AE977005AE3D4 /* AnalyticsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CE42F138166AE976005AE3D4 /* AnalyticsHelper.m */; }; CE42F147166AE977005AE3D4 /* GoogleEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = CE42F139166AE976005AE3D4 /* GoogleEvent.h */; }; CE42F148166AE977005AE3D4 /* GoogleEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = CE42F13A166AE976005AE3D4 /* GoogleEvent.m */; }; @@ -47,6 +49,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + C469A05D170011780085BB41 /* GoogleUniversalTracking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoogleUniversalTracking.h; sourceTree = ""; }; + C469A05E170011780085BB41 /* GoogleUniversalTracking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoogleUniversalTracking.m; sourceTree = ""; }; CE42F107166AE7FE005AE3D4 /* Google Analytics SDK for OSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = "Google Analytics SDK for OSX.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; CE42F10A166AE7FE005AE3D4 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; CE42F10D166AE7FE005AE3D4 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -152,6 +156,8 @@ CE42F13A166AE976005AE3D4 /* GoogleEvent.m */, CE42F13B166AE976005AE3D4 /* GoogleTracking.h */, CE42F13C166AE977005AE3D4 /* GoogleTracking.m */, + C469A05D170011780085BB41 /* GoogleUniversalTracking.h */, + C469A05E170011780085BB41 /* GoogleUniversalTracking.m */, CE816B8F166AF35D00D1FF53 /* JFUrlUtil.h */, CE816B90166AF35D00D1FF53 /* JFUrlUtil.m */, CE42F13D166AE977005AE3D4 /* NSString+URLEncoding.h */, @@ -221,6 +227,7 @@ CE42F151166AE977005AE3D4 /* TrackingRequest.h in Headers */, CE42F156166AEFA6005AE3D4 /* DDLog.h in Headers */, CE816B91166AF35D00D1FF53 /* JFUrlUtil.h in Headers */, + C469A05F170011780085BB41 /* GoogleUniversalTracking.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -340,6 +347,7 @@ CE42F152166AE977005AE3D4 /* TrackingRequest.m in Sources */, CE42F157166AEFA6005AE3D4 /* DDLog.m in Sources */, CE816B92166AF35D00D1FF53 /* JFUrlUtil.m in Sources */, + C469A060170011780085BB41 /* GoogleUniversalTracking.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From f46cedbedfb5d6b1b9fc12285cdeb488c4d579b7 Mon Sep 17 00:00:00 2001 From: Jerry Tian Date: Mon, 25 Mar 2013 16:07:50 +0800 Subject: [PATCH 2/7] enhance README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ec4c85..9371c37 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This unofficial SDK allows you to track usage of your OS X applications. Google Instructions ------------ -1. Add your Google Analytics ID to the project pList +1. Add your Google Analytics ID to the project pList. For development, using key(without quotes): "Google Analytics ID (Debug)"; For release, using key(without quotes): "Google Analytics ID (Release)". 2. Build the framework 3. Add the framework as a reference to your app's project From e15e92d92098ad372a0deadfd71eb87cf2c3c068 Mon Sep 17 00:00:00 2001 From: Jerry Tian Date: Mon, 25 Mar 2013 16:15:02 +0800 Subject: [PATCH 3/7] adding new tracking API from Google Analytics. --- .../Classes/AnalyticsHelper.h | 3 +- .../Classes/GoogleUniversalTracking.h | 16 ++++ .../Classes/GoogleUniversalTracking.m | 77 +++++++++++++++++++ 3 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.h create mode 100644 Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m diff --git a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h index 719ee28..923b05b 100644 --- a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h +++ b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h @@ -6,8 +6,7 @@ // http://github.com/noahsw/google-analytics-sdk-for-osx // -#define GANALYTICS_DOMAIN @"voyagerapps.com" - +#define GANALYTICS_DOMAIN @"app.ga" @interface AnalyticsHelper : NSObject diff --git a/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.h b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.h new file mode 100644 index 0000000..180650c --- /dev/null +++ b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.h @@ -0,0 +1,16 @@ +// +// GoogleMeasurementProtocolEvent.h +// Google Analytics SDK for OSX +// +// Created by Jerry Tian on 3/25/13. +// Copyright (c) 2013 Noah Spitzer-Williams. All rights reserved. +// + +#import +#import "TrackingRequest.h" + +@interface GoogleUniversalTracking : NSOperation + +@property (strong) TrackingRequest* request; + +@end diff --git a/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m new file mode 100644 index 0000000..0211e0b --- /dev/null +++ b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m @@ -0,0 +1,77 @@ +// +// GoogleMeasurementProtocolEvent.m +// Google Analytics SDK for OSX +// +// Created by Jerry Tian on 3/25/13. +// Copyright (c) 2013 Noah Spitzer-Williams. All rights reserved. +// + +#import "GoogleUniversalTracking.h" +#import "PublicIP.h" +#import "JFUrlUtil.h" + +#import "DDLog.h" +static const int ddLogLevel = LOG_LEVEL_VERBOSE | LOG_LEVEL_INFO | LOG_LEVEL_ERROR | LOG_LEVEL_WARN; + +@implementation GoogleUniversalTracking + + +- (void) main { + if (![NSThread isMainThread]) { + [self performSelectorOnMainThread:@selector(main) withObject:nil waitUntilDone:NO]; + return; + } + + [NSThread setThreadPriority:0.1]; + [NSThread sleepForTimeInterval:1]; + + NSString* analyticsAccountCode = nil; + NSBundle* mainBundle = [NSBundle mainBundle]; +#if DEBUG + analyticsAccountCode = [mainBundle objectForInfoDictionaryKey:@"Google Analytics ID (Debug)"]; +#else + analyticsAccountCode = [mainBundle objectForInfoDictionaryKey:@"Google Analytics ID (Release)"]; +#endif + + NSAssert(analyticsAccountCode!=nil, @"analyticsAccountCode can not be nil, set it in your info.plist."); + + //the origin author using the fields this way: + //label => client UUID + //category => client version + //action => event name + //value => event value(number) + GoogleEvent * event = self.request.trackingEvent; + + + GoogleEvent* trackingEvent = [self.request trackingEvent]; + //see "Event tracking para": + //https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide + NSString * payload = [NSString stringWithFormat:@"v=1&tid=%@&cid=%@&t=event&ec=%@&ea=%@&el=%@&ev=%@", + analyticsAccountCode, + [JFUrlUtil encodeUrl:event.label], + [JFUrlUtil encodeUrl:event.category], + [JFUrlUtil encodeUrl:event.action], + @"", + event.val + ]; + + + + + @try { + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString: @"http://www.google-analytics.com/collect"]]; + [request setHTTPMethod:@"POST"]; + [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"]; + [request setHTTPBody:[payload dataUsingEncoding: NSUTF8StringEncoding]]; + NSData *returnData = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil]; + + if (returnData && [returnData length] > 0) + DDLogInfo(@"Analytics event (%@, %@, %@, %@): triggered successfully!", [trackingEvent category], [trackingEvent action], [trackingEvent label], [trackingEvent val]); + else + DDLogInfo(@"Analytics event (%@, %@, %@, %@): trigger error", [trackingEvent category], [trackingEvent action], [trackingEvent label], [trackingEvent val]); + } + @catch (NSException *exception) { + DDLogInfo(@"Analytics event (%@, %@, %@, %@): exception thrown %@", [trackingEvent category], [trackingEvent action], [trackingEvent label], [trackingEvent val], exception); + } +} +@end From e9814a2e87f55329515aa09cf6ddeeadd6332e06 Mon Sep 17 00:00:00 2001 From: Jerry Tian Date: Tue, 26 Mar 2013 11:58:54 +0800 Subject: [PATCH 4/7] fix threading issue. --- Google Analytics SDK for OSX/Classes/GoogleTracking.m | 4 ++-- .../Classes/GoogleUniversalTracking.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Google Analytics SDK for OSX/Classes/GoogleTracking.m b/Google Analytics SDK for OSX/Classes/GoogleTracking.m index d26e948..541487f 100644 --- a/Google Analytics SDK for OSX/Classes/GoogleTracking.m +++ b/Google Analytics SDK for OSX/Classes/GoogleTracking.m @@ -32,8 +32,8 @@ - (id)init - (void)main { - if (![NSThread isMainThread]) { - [self performSelectorOnMainThread:@selector(main) withObject:nil waitUntilDone:NO]; + if ([NSThread isMainThread]) { + [self performSelectorInBackground:@selector(main) withObject:nil]; return; } diff --git a/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m index 0211e0b..4035dd1 100644 --- a/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m +++ b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m @@ -17,8 +17,8 @@ @implementation GoogleUniversalTracking - (void) main { - if (![NSThread isMainThread]) { - [self performSelectorOnMainThread:@selector(main) withObject:nil waitUntilDone:NO]; + if ([NSThread isMainThread]) { + [self performSelectorInBackground:@selector(main) withObject:nil]; return; } From a65b6b9516dfd621e77adf2f129810b6c5fc759f Mon Sep 17 00:00:00 2001 From: Jerry Tian Date: Wed, 27 Mar 2013 10:35:12 +0800 Subject: [PATCH 5/7] don't read bundle on every request. --- .../Classes/GoogleUniversalTracking.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m index 4035dd1..fe5a749 100644 --- a/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m +++ b/Google Analytics SDK for OSX/Classes/GoogleUniversalTracking.m @@ -25,13 +25,15 @@ - (void) main { [NSThread setThreadPriority:0.1]; [NSThread sleepForTimeInterval:1]; - NSString* analyticsAccountCode = nil; - NSBundle* mainBundle = [NSBundle mainBundle]; + static NSString* analyticsAccountCode = nil; + if (analyticsAccountCode == nil) { + NSBundle* mainBundle = [NSBundle mainBundle]; #if DEBUG - analyticsAccountCode = [mainBundle objectForInfoDictionaryKey:@"Google Analytics ID (Debug)"]; + analyticsAccountCode = [mainBundle objectForInfoDictionaryKey:@"Google Analytics ID (Debug)"]; #else - analyticsAccountCode = [mainBundle objectForInfoDictionaryKey:@"Google Analytics ID (Release)"]; + analyticsAccountCode = [mainBundle objectForInfoDictionaryKey:@"Google Analytics ID (Release)"]; #endif + } NSAssert(analyticsAccountCode!=nil, @"analyticsAccountCode can not be nil, set it in your info.plist."); From 398a2e74640cf2d609ed252519ccbabfc5ba1405 Mon Sep 17 00:00:00 2001 From: Jerry Tian Date: Thu, 28 Mar 2013 11:46:21 +0800 Subject: [PATCH 6/7] fix project configuration when build as sub project and bundle the library. --- .../project.pbxproj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj b/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj index 57840bf..d194bda 100644 --- a/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj +++ b/Google Analytics SDK for OSX/Google Analytics SDK for OSX.xcodeproj/project.pbxproj @@ -447,14 +447,16 @@ CE42F132166AE7FF005AE3D4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COMBINE_HIDPI_IMAGES = YES; + COMBINE_HIDPI_IMAGES = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Classes/Google Analytics SDK for OSX-Prefix.pch"; INFOPLIST_FILE = "Classes/Google Analytics SDK for OSX-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = framework; }; name = Debug; @@ -462,14 +464,16 @@ CE42F133166AE7FF005AE3D4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COMBINE_HIDPI_IMAGES = YES; + COMBINE_HIDPI_IMAGES = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Classes/Google Analytics SDK for OSX-Prefix.pch"; INFOPLIST_FILE = "Classes/Google Analytics SDK for OSX-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = framework; }; name = Release; From 1486f2997b3ebf81034b4897aedbf0762d763c0f Mon Sep 17 00:00:00 2001 From: Jerry Tian Date: Mon, 9 Sep 2013 14:26:26 +0800 Subject: [PATCH 7/7] correct a typo --- Google Analytics SDK for OSX/Classes/AnalyticsHelper.h | 2 +- Google Analytics SDK for OSX/Classes/AnalyticsHelper.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h index 923b05b..e1aeb85 100644 --- a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h +++ b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.h @@ -12,7 +12,7 @@ +(BOOL) fireEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue; -+(BOOL) mearsureEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue; ++(BOOL) measureEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue; @end diff --git a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m index d1946ff..45ae8e9 100644 --- a/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m +++ b/Google Analytics SDK for OSX/Classes/AnalyticsHelper.m @@ -72,7 +72,7 @@ +(BOOL) fireEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue } -+(BOOL) mearsureEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue { ++(BOOL) measureEvent: (NSString*)eventAction eventValue:(NSNumber*)eventValue { NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary]; NSString* eventCategory = [NSString stringWithFormat:@"Mac %@", infoDict[@"CFBundleShortVersionString"]];