Rich-text Reply

Experiment Javascript is not working

pravingkd 08-16-16

Experiment Javascript is not working

I am using Optimizely for A/B testing, I have created 2 variations both have same button with same ID and I have written Jquery alert when click that button but it's not working.

 

Script is as :

 

$(document).ready(function(){
$('#addPopclip').click(function(){
alert('Clicked');
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "popclipAddToCart"]);
});
});

JasonDahlin 08-16-16
 

Re: Experiment Javascript is not working

Try "window.alert"

$(document).ready(function(){
  $('#addPopclip').click(function(){
    window.alert('Clicked');
    window['optimizely'] = window['optimizely'] || [];
    window.optimizely.push(["trackEvent", "popclipAddToCart"]);
  });
});
--Jason Dahlin
Analytics and Testing Guru Smiley Happy
Experimentation Hero
pravingkd1 08-17-16
 

Re: Experiment Javascript is not working

Hey JasonDahlin

 

Thank for your reply,

Given modified code is not working,

I would like to add one more thing here as I'm using trial version for now,

initially my code was working for 3-4 attempts even tracking were showing result after that It has been stopped I tried to compress snippet size and many solutions but nothing happened.

 

Waiting for your reply...