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: Add audit trial length optimizely experiment #82

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

ilee2u
Copy link
Member

@ilee2u ilee2u commented Jan 31, 2025

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.

- Add the experiment and variation keys
- And some logic for upgrade eligibility
// );
}


const upgradeUrl = offer?.upgradeUrl || verifiedMode?.upgradeUrl;
Copy link
Member Author

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.

Copy link
Member

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?

isUpgradeEligible = true;

// Do I need to add a sendTrackEvent call like this?
// sendTrackEvent(
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

@MichaelRoytman MichaelRoytman left a 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.

@@ -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
Copy link
Member

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.

@ilee2u ilee2u merged commit c2304e5 into main Feb 4, 2025
4 checks passed
@ilee2u ilee2u deleted the ilee2u/add-audit-trial-length-optimizely-experiment branch February 4, 2025 16:12
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.

2 participants