Last active
August 7, 2025 16:54
-
-
Save robisatthefunction/525c93a795339e8a78da0ef3755784c1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // [WARNING] You must disable 'Mask descriptive names in project code and third-party' in this project's settings for this to work! See here https://support.optimizely.com/hc/en-us/articles/4410284343181-Project-Settings-Privacy#01H84ETPDDFDXMTYDWWAX92EKG | |
| var decisionObject = window.optimizely.get('state').getDecisionObject({ | |
| campaignId: campaignId, | |
| shouldCleanString: true | |
| }); | |
| var utils = window.optimizely.get('utils'); | |
| function sendToAnalyticsProvider() { | |
| var experimentName = decisionObject.experiment.split(' ')[0]; | |
| var variationName = decisionObject.variation.split(' ')[0]; | |
| utils.waitUntil(function(){ | |
| return !!window.analyticsObject; // Change to analytics provider window object | |
| }).then(function(){ | |
| // Send to analytics provider code | |
| }); | |
| } | |
| if ((!!decisionObject && decisionObject.holdback === undefined) || decisionObject.holdback === false) { | |
| sendToAnalyticsProvider(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment