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

[NT-1194] Migrate Optimizely events to send to the Data Lake #1177

Merged
merged 17 commits into from
May 1, 2020

Conversation

ifbarrera
Copy link
Contributor

@ifbarrera ifbarrera commented Apr 27, 2020

📲 What

Migrates some events that were previously being sent to Optimizely via the Optimizely SDK, to be sent instead to the data lake. This will allow us to send events directly to both Optimizely and Amplitude through data lake lambdas.

🤔 Why

In preparation for migrating all our Optimizely events to send from data lake lambdas, we need to make sure that these events are flowing through the data lake. Moving forward, all Optimizely events will flow through the data lake, so we no longer need to track anything through the Optimizely SDK.

🛠 How

  • remove track function from the OptimizelyClientType protocol
  • removes helper functions that previously populated Optimizely user attribute and event tags for tracking purposes
  • removes all calls to track on the Optimizely SDK
  • adds necessary events to the list of whitelisted data lake events
  • replaces previous Optimizely SDK tracking calls with calls to the Koala client on the AppEnvironment

Note that adding the necessary Optimizely properties to the event property groups will be done in a follow-up PR.

✅ Acceptance criteria

Test that the follow events are being sent through the Data Lake, instead of through the Optimizely SDK:

  • Campaign Details Pledge Button Clicked
  • App Closed event should be removed
  • App Completed Checkout event should be removed (this will be sent by the backend to Optimizely)
  • Campaign Details Button Clicked
  • Onboarding Get Started Button Clicked (note: context_location should be landing_page )
  • Onboarding Skip Button Clicked (context_location should be onboarding)
  • Onboarding Continue Button Clicked (context_location should be onboarding)
  • Creator Details Clicked

Copy link
Contributor

@justinswart justinswart left a comment

Choose a reason for hiding this comment

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

Cool cool, just few q's

@@ -417,11 +409,11 @@ final class AppDelegateViewModelTests: TestCase {
XCTAssertEqual(["App Open", "Opened App"], trackingClient.events)

self.vm.inputs.applicationDidEnterBackground()
XCTAssertEqual(["App Open", "Opened App", "App Close", "Closed App"], trackingClient.events)
Copy link
Contributor

Choose a reason for hiding this comment

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

Decided to not track App Close anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that's right.

@@ -57,11 +64,14 @@ public final class Koala {
/// Determines the screen from which the event is sent.
public enum LocationContext: String {
case activities = "activity_feed_screen" // ActivitiesViewController
case campaign = "campaign_screen"
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the // <view controller> for this one?

Library/Tracking/Koala.swift Outdated Show resolved Hide resolved
let attributes = optimizelyUserAttributes(refTag: refTag)

try? AppEnvironment.current.optimizelyClient?.track(
eventKey: "Editorial Card Clicked",
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed because the campaign is over right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR removes all events previously tracked on the Optimizely SDK, because those events have been migrated to the data lake. An upcoming PR will add the necessary Optimizely properties to the required events.


try? AppEnvironment.current.optimizelyClient?
.track(
eventKey: "App Completed Checkout",
Copy link
Contributor

Choose a reason for hiding this comment

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

I understood that we still wanted this event.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, the backend will be sending this.

@nativeksr
Copy link
Collaborator

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@ifbarrera ifbarrera merged commit 4a612fd into feature-optimizely-tracking May 1, 2020
ifbarrera added a commit that referenced this pull request May 22, 2020
* [NT-1162] Add OptimizelyProperties (#1172)

* Add new optimizely props

* optimizelyProps tests

* Change to “unknown”

* Update test name

* Use fake experiments strings for tests

* Simplyfing allExperiments code

* [NT-1194] Migrate Optimizely events to send to the Data Lake (#1177)

* Add new optimizely props

* optimizelyProps tests

* Change to “unknown”

* Update test name

* Use fake experiments strings for tests

* Add missing whitelisted data lake events

* Add new whitelisted events

* Add carousel swiped event

* Onboarding tracking events & tests

* Remove “App Completed Checkout”

* Updating tests

* Simplyfing allExperiments code

* Tracking tests

* Removing optimizely tracking references

* Cleaning up

* [NT-1174] Add Optimizely Properties to relevant events (#1180)

* Add new optimizely props

* optimizelyProps tests

* Change to “unknown”

* Update test name

* Use fake experiments strings for tests

* Add missing whitelisted data lake events

* Add new whitelisted events

* Add carousel swiped event

* Onboarding tracking events & tests

* Remove “App Completed Checkout”

* Updating tests

* Simplyfing allExperiments code

* Tracking tests

* Removing optimizely tracking references

* Add optimizely properties to creator details viewed and campaign button clicked

* Add optimizely properties to relevant events

* Formatting

* Cleaning up

* Cleaning up test name

* Coalesce to an empty dictionary for opty props

* Fixing merge conflict issues
@justinswart justinswart deleted the NT-1194-migrate-opty-events branch June 15, 2021 15:08
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.

3 participants