Rich-text Reply

Click Goals on a Checkbox

Evanson509613 12-03-14

Click Goals on a Checkbox

This may be a silly question, and I apologize in advance if it is, but I have a few checkboxes that I am tracking as click goals in my experiment. I am wondering if Optimizely will track if a user checks and then UNchecks the box as 2 separate clicks or if it will only track the first click?

 

Thank you in advance to anyone who has the answer, and again, I am sorry if this is a silly question.

MJBeisch 12-03-14
 

Re: Click Goals on a Checkbox

Click goals are bound to the mousedown event, so technically yes both a "check" click and "uncheck" click would be tracked. However, all goals (other than Total Revenue) are de-duplicated (as detailed in the support article on revenue goals), so even if the same user triggers a goal criteria multiple times, it is only counted once.

Matt Beischel - E-Commerce Optimization Specialist CohereOne

Level 2

Re: Click Goals on a Checkbox

Thank you MJBeisch!
MJBeisch 12-05-14
 

Re: Click Goals on a Checkbox

[ Edited ]

Thinking about it a bit more in depth, it is possible to track "check" and "uncheck" clicks as separate goals. You would just have to set them up as custom event goals (rather than a click goal) and add some jQuery to your site to trigger the trackEvent API call after checking the checkbox state. Something like:

 

$('#unique-checkbox-id').mousedown(function(event) {
    if( $(this).is(":checked") ) {
        window['optimizely'] = optimizely || [];
        window['optimizely'].push(["trackEvent", "unique-checkox-was-checked"]);
    }
    else {
        window['optimizely'] = optimizely || [];
        window['optimizely'].push(["trackEvent", "unique-checkox-was-unchecked"]);
    }
});

 

Matt Beischel - E-Commerce Optimization Specialist CohereOne

Level 2