-
Notifications
You must be signed in to change notification settings - Fork 4
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: Add audit trial length optimizely experiment #82
feat: Add audit trial length optimizely experiment #82
Conversation
- Add the experiment and variation keys - And some logic for upgrade eligibility
// ); | ||
} | ||
|
||
|
||
const upgradeUrl = offer?.upgradeUrl || verifiedMode?.upgradeUrl; |
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.
I was a little unclear on what the instruction to "Update logic here to make upgrade eligible if in experiment variation" meant, since the isUpgradeEligible
boolean is already passed into this function. Let me know if I had the right idea.
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.
Theoretically, what you'd want to change is what is returned from this function. I agree that modifying isUpgradeEligible
wouldn't make sense.isUpgradeEligible
represents whether the learner is in a course mode that makes them eligible to upgrade to a paid seat.
Having said that, for the two variation keys, I don't think you'd want to change anything here, right? In both variations, upgradeable
should be true
. And backend will handle setting the correct length for the trial based on the variation keys using the Python SDK (i.e. auditTrialLengthDays
.
I think what we want to do is NOT render the audit trial experience when the learner is in the off
or control
variations. What do you think?
src/hooks/use-course-upgrade.js
Outdated
isUpgradeEligible = true; | ||
|
||
// Do I need to add a sendTrackEvent call like this? | ||
// sendTrackEvent( |
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.
Is this an event we need to track? If so, I think it would make more sense to log the event on clicking the audit trial CTA or on the backend when the audit trial is created.
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.
Ah good point, I think calling this on the backend makes a lot more sense
- also added tests
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.
I left one nit.
src/hooks/use-course-upgrade.js
Outdated
@@ -28,6 +31,7 @@ const millisecondsInOneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milli | |||
* | |||
* @returns {CourseUpgradeInfo} | |||
*/ | |||
// Update logic here to make upgrade eligible if in experiment variation |
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.
Do you need this comment? It looks like a note to self. If so, please remove it.
Ticket: https://2u-internal.atlassian.net/browse/COSMO-642
Added the experiment and variation keys for the Audit Trial Length experiment in Optimizely.
Also added a bit of logic for gating upgrade eligibility.