Rich-text Reply

Tracking conditional custom event

alanho 11-03-15
Accepted Solution

Tracking conditional custom event

Hi, I would like to know what happens in such a scenario:

 

  1. I have a webform (assuming Original with white background; and Variation #1 has blue background). The hypothesis is that the challenger will trigger more form submissions and also check more opt-ins.
    Optimizely Question.png
  2. To track the form submission, I have hooked up the form submit event to push custom events goals.

    window['optimizely'] = window['optimizely'] || [];
    $( "#consumer_register_form" ).submit(function( event ) {
    window.optimizely.push(["trackEvent", "formSubmitInclKey"]);
    console.log ("Submit Form");

    if ($('#OptIn').is(":checked")){
    window.optimizely.push(["trackEvent", "formSubmitOptIn"]);
    console.log ("Submit Form with Opt-In");
    }
    });

     
  3. In the code stated in #2. There would be a scenario whereby two custom events that could be fired simultaneously; which I'll be tracking for unique conversions (submission of form with and without the opt-in checked).
  4. Say if I were to submit this form twice.
    The first time, I submit the form without the Opt-In checked. (This would push the only event 'formSubmitInclKey')
    The second time, I submit the form again but this time with the Opt-In checked.

 

What happens at the second submission?

  • I'm assuming that 'formSubmitInclKey' will not be tracked again from How Optimizely Collects Results.
  • However, is the conversion goal for 'formSubmitOptIn' tracked?

 

 

- Alan Ho
Level 3

Amanda 11-03-15
 

Re: Tracking conditional custom event

Goals are de-duplicated by user ID.  Here's your scenario

 

Say if I were to submit this form twice.
The first time, I submit the form without the Opt-In checked. (This would push the only event 'formSubmitInclKey')

Only the first goal formSubmitInclKey would be sent. This is the first event for that user, so it would increment this goal by 1


The second time, I submit the form again but this time with the Opt-In checked.

Both goals would be sent, but since this user has already triggered one goal for the Submit button, this goal would not increment by one (it is de-duplicated). However, for the opt-in checked goal, this is the first time this user has triggered this goal, so it would increment the opt-in goal by 1. 

 

Your assumption is totally correct. Let us know if you have more questions

Optimizely