-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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-647] "Thanks Page Viewed" event #1035
Conversation
…NT-647-thank-you-event # Conflicts: # Library/Tracking/Koala.swift
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks pretty legit! I just had a question regarding some tests and other minor things. Good job!
|
||
self.scheduler.run() | ||
|
||
self.goToThanks.assertValues([project]) | ||
self.goToThanksProject.assertValues([project]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we assert the values of goToThanksReward
and goToThanksCheckoutData
here too? 🤔
self.showErrorBannerWithMessage.assertDidNotEmitValue() | ||
|
||
self.scheduler.run() | ||
|
||
self.beginSCAFlowWithClientSecret.assertDidNotEmitValue() | ||
self.submitButtonEnabled.assertValues([false, true, false, true]) | ||
self.submitButtonIsLoading.assertValues([true, false]) | ||
self.goToThanks.assertValues([.template]) | ||
self.goToThanksProject.assertValues([.template]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here too
@@ -3095,7 +3114,7 @@ final class PledgeViewModelTests: TestCase { | |||
|
|||
self.beginSCAFlowWithClientSecret.assertValues(["client-secret"]) | |||
self.submitButtonEnabled.assertValues([false, true, false, true]) | |||
self.goToThanks.assertValues([project]) | |||
self.goToThanksProject.assertValues([project]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
fileprivate let goToThanks = TestObserver<Project, Never>() | ||
fileprivate let goToThanksProject = TestObserver<Project, Never>() | ||
fileprivate let goToThanksReward = TestObserver<Reward, Never>() | ||
fileprivate let goToThanksCheckoutData = TestObserver<Koala.CheckoutPropertiesData?, Never>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you alpha here? 🙈
fileprivate let goToThanks = TestObserver<Project, Never>() | ||
fileprivate let goToThanksProject = TestObserver<Project, Never>() | ||
fileprivate let goToThanksReward = TestObserver<Reward, Never>() | ||
fileprivate let goToThanksCheckoutData = TestObserver<Koala.CheckoutPropertiesData?, Never>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alpha here too
private let goToThanks = TestObserver<Project, Never>() | ||
private let goToThanksProject = TestObserver<Project, Never>() | ||
private let goToThanksReward = TestObserver<Reward, Never>() | ||
private let goToThanksCheckoutData = TestObserver<Koala.CheckoutPropertiesData?, Never>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 🚢 🚢 🚢
🚢 🚢 🚢 🚢
🚢 🚢 🚢 🚢
🚢 🚢 🚢 🚢
📲 What
Adds the
Thanks Page Viewed
event.🤔 Why
Tracking events cleanup.
🛠 How
Adds the
Thanks Page Viewed
event which includesprojectProperties
,pledgeProperties
andcheckoutProperties
. Because the checkout properties are mostly defined inPledgeViewModel
, they're passed through to theThanksViewModel
via the configuration function.✅ Acceptance criteria
With the
KOALA_ENABLED
environment variable set totrue
, test the event by backing any project. You should see theThanks Page Viewed
event fire when you get to the thanks page, with the following properties:checkout_amount
// pledge total including shippingcheckout_payment_type
// eitherCREDIT_CARD
orAPPLE_PAY
checkout_reward_id
checkout_reward_title
checkout_shipping_amount
checkout_revenue_in_usd_cents
checkout_reward_estimated_delivery_on
checkout_reward_shipping_enabled
checkout_user_has_eligible_stored_apple_pay_card
as well as all
projectProperties
andpledgeProperties
.Note that you'll only see
checkoutProperties
when backing a project through the native pledge view experience, although theThanks Page Viewed
event will also fire through the deprecated checkout experience.