Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat): easy event tracking. #359

Merged
merged 6 commits into from
Jan 22, 2019
Merged

(feat): easy event tracking. #359

merged 6 commits into from
Jan 22, 2019

Conversation

thomaszurkan-optimizely
Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely commented Jan 16, 2019

Summary

Event builder change.

  • Always pass "enrich_decisions" as true
  • Only pass in decisions for impression event.
    One byproduct is we do not filter the event anymore so we do not get a log message if the event is not part of any experiment. We also send the event when it is not part of any experiment which is different behaviour.

Test plan

Added a test that makes sure enhance_decisions is set

Issues

  • We are losing logging and always sending an event which is different behaviour that previously.

@coveralls
Copy link

coveralls commented Jan 16, 2019

Coverage Status

Coverage decreased (-0.009%) to 97.924% when pulling b9280e3 on easyEventTracking into 7f47f68 on master.

@aliabbasrizvi aliabbasrizvi requested a review from mjc1283 January 16, 2019 22:06
Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update title to be correct. I don't think log messages are an issue.

@@ -27,7 +28,7 @@

// --- Visitor Parameters ----
NSString * const OPTLYEventParameterKeysSnapshots = @"snapshots"; // nonnull
NSString * const OPTLYEventParameterKeysVisitorId = @"visitor_id"; // nonnull
NSString * const OPTLYEventParameterKeysVisitorId = @"visitor_id"; // nonnull @"enrich_decisions"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enrich_decisions?

@@ -1626,7 +1626,7 @@ - (void)testTrackWithAttributesComplexAudienceMismatch {

[self.optimizelyTypedAudience track:@"user_signed_up" userId:@"test_user" attributes:userAttributes];
NSString *logMessage = [NSString stringWithFormat:OPTLYLoggerMessagesConversionFailure, @"user_signed_up"];
OCMVerify([loggerMock logMessage:logMessage withLevel:OptimizelyLogLevelInfo]);
//OCMVerify([loggerMock logMessage:logMessage withLevel:OptimizelyLogLevelInfo]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed right?

@@ -1386,7 +1386,7 @@ - (void)testTrackExcludesUserFromExperimentWithTypedAudiences {
}]];
[optimizely track:eventId userId:userId attributes:attributes];
NSString *logMessage = [NSString stringWithFormat:OPTLYLoggerMessagesConversionFailure, eventId];
OCMVerify([loggerMock logMessage:logMessage withLevel:OptimizelyLogLevelInfo]);
//OCMVerify([loggerMock logMessage:logMessage withLevel:OptimizelyLogLevelInfo]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed right?

@yasirfolio3
Copy link
Contributor

Headers need to be updated.

@thomaszurkan-optimizely thomaszurkan-optimizely changed the title (feat): first pass at easy event tracking. We lose some logging with this im… (feat): easy event tracking. Jan 17, 2019
Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can get rid of https://github.com/optimizely/objective-c-sdk/blob/master/OptimizelySDKCore/OptimizelySDKCore/Optimizely.m#L912-L961 and associated unit tests.

Will wait to get resolution for compatibility tests before we can get this in.

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2016,2018, Optimizely, Inc. and contributors *
* Copyright 2016-2019, Optimizely, Inc. and contributors *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. This should actually be 2016, 2018-2019 based on what it was previously.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean we weren't copyrighted in 2017? I will change it, but, seems weird.

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Also, @msohailhussain confirmed that tests are fine.

Going to merge this change.

@aliabbasrizvi aliabbasrizvi merged commit 1425d4b into master Jan 22, 2019
@aliabbasrizvi aliabbasrizvi deleted the easyEventTracking branch January 22, 2019 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants