Rich-text Reply

Custom Event not Calling Back via HTTP request

mattgregg 02-21-15
Accepted Solution

Custom Event not Calling Back via HTTP request

I'm having an issue setting up a custom event where the event shows up in the Preview "Events" tab but it doesn't make a call via http. There is no network call for this event. 

The event is called via a setTimout function which opens a popup. Popup opens, function called to push custom event. I have set up the custom event with the same name as a goal for the experiment and again the event displays in the Preview panel just not via http. Here's  the code if anyone has any thoughts on how to address this - 

 

function trackEvent(name) {
window.optimizely = window['optimizely'] || [];
window.optimizely.push(["trackEvent", name]);
}
function showPopup() {
$("#dialog, #mask").css("display", "block");
trackEvent("popup");
}
$(document).ready(function() {
var cookie = readCookie("regPromo");
if (cookie == null) {
var timeout;
timeout = window.setTimeout(showPopup, 10000);
}

 

Thanks.

michaelwei 02-25-15
 

Re: Custom Event not Calling Back via HTTP request

Hi mattgregg,

 

How are you testing it via http? If you're using the Force Variation parameter, it actually disables all events by default to prevent QA testing from contaminating your results. If you're ok with those calls going through, add another query parameter in addition to the optimizely_x parameter: "optimizely_force_tracking=true". You should then see the events coming through via network traffic. You may also see double - that's perfectly normal and does not indicate you're double-firing.

Optimizely
mattgregg 02-25-15
 

Re: Custom Event not Calling Back via HTTP request

Hi Michael,

That was it. Thanks so much. I wasn't aware of this default and having events blocked.