forked from adamlaska/circleci-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignUpCTA.js
More file actions
23 lines (23 loc) · 865 Bytes
/
signUpCTA.js
File metadata and controls
23 lines (23 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// https://app.optimizely.com/v2/projects/16812830475/experiments/21229840508/variations
window.OptimizelyClient.getVariationName({
experimentKey: 'dd_update_signup_cta_test',
groupExperimentName: 'q1_fy23_docs_disco_experiment_group_test',
experimentContainer: '.global-nav--footer',
guestExperiment: true,
}).then((variation) => {
const ctaBtn = document.getElementById('signup-cta');
if (variation === 'treatment') {
ctaBtn.innerHTML = 'Start Building for Free';
ctaBtn.addEventListener('click', () => {
window.AnalyticsClient.trackAction('Clicked New Signup CTA', {
ctaText: 'Start Building for Free',
});
});
} else if (variation === 'control') {
ctaBtn.addEventListener('click', () => {
window.AnalyticsClient.trackAction('Clicked Old Signup CTA', {
ctaText: 'Signup',
});
});
}
});