diff --git a/WordPressShared/Core/Analytics/WPAnalytics.h b/WordPressShared/Core/Analytics/WPAnalytics.h index f8b6fe0..00beb56 100644 --- a/WordPressShared/Core/Analytics/WPAnalytics.h +++ b/WordPressShared/Core/Analytics/WPAnalytics.h @@ -601,8 +601,8 @@ extern NSString *const WPAnalyticsStatEditorPublishedPostPropertyVideo; + (void)endTimerForStat:(WPAnalyticsStat)stat withProperties:(NSDictionary *)properties; + (void)track:(WPAnalyticsStat)stat; + (void)track:(WPAnalyticsStat)stat withProperties:(NSDictionary *)properties; -+ (void)trackEvent:(NSString *)event; -+ (void)trackEvent:(NSString *)event withProperties:(NSDictionary *)properties; ++ (void)trackString:(NSString *)event; ++ (void)trackString:(NSString *)event withProperties:(NSDictionary *)properties; + (void)endSession; + (void)clearQueuedEvents; @@ -612,8 +612,8 @@ extern NSString *const WPAnalyticsStatEditorPublishedPostPropertyVideo; - (void)track:(WPAnalyticsStat)stat; - (void)track:(WPAnalyticsStat)stat withProperties:(NSDictionary *)properties; -- (void)trackEvent:(NSString *)event; -- (void)trackEvent:(NSString *)event withProperties:(NSDictionary *)properties; +- (void)trackString:(NSString *)event; +- (void)trackString:(NSString *)event withProperties:(NSDictionary *)properties; @optional - (void)beginSession; diff --git a/WordPressShared/Core/Analytics/WPAnalytics.m b/WordPressShared/Core/Analytics/WPAnalytics.m index c8018ab..5db3727 100644 --- a/WordPressShared/Core/Analytics/WPAnalytics.m +++ b/WordPressShared/Core/Analytics/WPAnalytics.m @@ -63,18 +63,18 @@ + (void)track:(WPAnalyticsStat)stat withProperties:(NSDictionary *)properties } } -+ (void)trackEvent:(NSString *)event ++ (void)trackString:(NSString *)event { for (id tracker in [self trackers]) { - [tracker trackEvent:event]; + [tracker trackString:event]; } } -+ (void)trackEvent:(NSString *)event withProperties:(NSDictionary *)properties ++ (void)trackString:(NSString *)event withProperties:(NSDictionary *)properties { NSParameterAssert(properties != nil); for (id tracker in [self trackers]) { - [tracker trackEvent:event withProperties:properties]; + [tracker trackString:event withProperties:properties]; } } diff --git a/WordPressSharedTests/TestAnalyticsTracker.m b/WordPressSharedTests/TestAnalyticsTracker.m index c1e9c42..33e1e1b 100644 --- a/WordPressSharedTests/TestAnalyticsTracker.m +++ b/WordPressSharedTests/TestAnalyticsTracker.m @@ -27,4 +27,14 @@ - (void)refreshMetadata // No-op } +- (void)trackString:(NSString *)event { + // No-op +} + + +- (void)trackString:(NSString *)event withProperties:(NSDictionary *)properties { + // No-op +} + + @end diff --git a/WordPressSharedTests/WPAnalyticsTests.m b/WordPressSharedTests/WPAnalyticsTests.m index 1eb0e0c..a8c99c9 100644 --- a/WordPressSharedTests/WPAnalyticsTests.m +++ b/WordPressSharedTests/WPAnalyticsTests.m @@ -117,20 +117,20 @@ itShouldBehaveLike(@"a WPAnalyticsTracker method", @{@"invocation": invocation}); }); -describe(@"trackEvent:", ^{ - NSMethodSignature *signature = [TestAnalyticsTracker instanceMethodSignatureForSelector:@selector(trackEvent:)]; +describe(@"trackString:", ^{ + NSMethodSignature *signature = [TestAnalyticsTracker instanceMethodSignatureForSelector:@selector(trackString:)]; NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; - [invocation setSelector:@selector(trackEvent:)]; + [invocation setSelector:@selector(trackString:)]; NSString *event = @"my_event"; [invocation setArgument:&event atIndex:2]; itShouldBehaveLike(@"a WPAnalyticsTracker method", @{@"invocation": invocation}); }); -describe(@"trackEvent:withProperties:", ^{ - NSMethodSignature *signature = [TestAnalyticsTracker instanceMethodSignatureForSelector:@selector(trackEvent:withProperties:)]; +describe(@"trackString:withProperties:", ^{ + NSMethodSignature *signature = [TestAnalyticsTracker instanceMethodSignatureForSelector:@selector(trackString:withProperties:)]; NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; - [invocation setSelector:@selector(trackEvent:withProperties:)]; + [invocation setSelector:@selector(trackString:withProperties:)]; NSString *event = @"my_event"; NSDictionary *dict = @{};