inboundnow / retired-leads

Track visitor activity, capture and manage incoming leads, and send collected emails to your email service provider for WordPress
http://www.inboundnow.com/leads/
11 stars 3 forks source link

IE 11 - Analytics Bug #56

Closed atwellpub closed 9 years ago

atwellpub commented 10 years ago

pageFirstView: function(page_seen_count) { var page_first_view = new CustomEvent("inbound_analytics_page_first_view", { detail: { count: 1, time: new Date(), }, bubbles: true, cancelable: true } );

Site repeatable: http://www.runmags.com

DavidWells commented 10 years ago

Whats the error? I dont have IE to see this

DavidWells commented 10 years ago

Looks like IE 9+ doesnt have the customEvent js.

Might need a browser type/version check and revert to this: http://stackoverflow.com/questions/19345392/why-arent-my-parameters-getting-passed-through-to-a-dispatched-event/19345563#19345563

// change this
pageFirstView: function(page_seen_count) {
var page_first_view = new CustomEvent("inbound_analytics_page_first_view", {
detail: {
count: 1,
time: new Date(),
},
bubbles: true,
cancelable: true
}
);

// to
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent('inbound_analytics_page_first_view', false, false, {
   count: 1,
   time: new Date(),
});

And test out in IE. The syntax might be wrong on the second. look here for that http://stackoverflow.com/questions/19345392/why-arent-my-parameters-getting-passed-through-to-a-dispatched-event/19345563#19345563

atwellpub commented 10 years ago

Hey David where do you think the patch should go. And how should it read in psedo-code? eg:

"If browser is IE 11 then do this"