Skip to content
New issue

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

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

Already on GitHub? # to your account

[NT-721] Updating Project Page Viewed event timing #1005

Merged
merged 3 commits into from
Jan 2, 2020

Conversation

ifbarrera
Copy link
Contributor

@ifbarrera ifbarrera commented Dec 24, 2019

📲 What

Updates the logic of when the Project Page Viewed event fires so that we can track all project properties.

🤔 Why

Previously, we were firing the Project Page Viewed event right when the project page is configured. Because we prefix the fetchProject request with a partial project object, the Project Page Viewed event was being sent with incomplete projectProperties.

Now, we wait for the fetchProject request to complete with the full project object before we track the Project Page Viewed event -- this allows us to send the event with all project properties.

🛠 How

Shuffling around the view model logic for the Project Page Viewed event.

✅ Acceptance criteria

Make sure you have the KOALA_TRACKING environment variable set to true

  • Navigate to any project. You should eventually see the Project Page Viewed event fire with the following properties populated:
    • project_rewards_count // should not be zero
    • project_updates_count
    • project_comments_count
  • Tap "Back this project" to navigate to the rewards carousel, then tap the X to close the rewards carousel. You should see the project page again and the Project Page Viewed event should fire again.

Signal.combineLatest(
freshProjectAndRefTag,
cookieRefTag,
Signal.zip(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that we'll need to change this to a combineLatest once #996 merges, because the fetchProject request will no longer fire on viewDidAppear.

@@ -840,30 +876,6 @@ final class ProjectPamphletViewModelTests: TestCase {
}
}

func testBackThisProjectButton_Tracking() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this test because it wasn't really testing anything that we weren't already verifying in other tests 🤔

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.

Legit!

@ifbarrera ifbarrera merged commit ed7e124 into master Jan 2, 2020
@ifbarrera ifbarrera deleted the NT-721-project-viewed-event branch January 2, 2020 23:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants