Last active
November 18, 2019 22:20
-
-
Save isquick82/50e440ddaff85a77e181f6ae87a16d11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A/B Test for Adding a Discount Option to Product | |
if (enabled) { | |
// The variable amount can be remotely configured from Optimizely UI | |
const discountAmount = optimizelyClientInstance.getFeatureVariable('discount', 'amount', userId); | |
console.log(`${userId} got a discount of $${discountAmount}`); | |
} else { | |
console.log(`${userId} did not get the discount feature`); | |
} | |
//after we’ve confirmed purchase completed | |
optimizelyClientInstance.track('purchase', userId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment