You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Lightboxes with the KISSmetrics -> General tracking -> Links in posts/pages setting active I'm experiencing the following issue:
The Lightbox opens for a second then it redirects me to the URL of the actual Image.
This is caused by the "trackClickOnOutboundLink" event handler which is attached to all links within the post/page when the setting is active.
KM.trackClickOnOutboundLink=function(a,b,c){KM.e$(a,function(a){KM.ev(a,"click",function(a){try{KM.record(b,c)}catch(d){}for(varf=KM.sre(a);f&&(!f.href||"a"!=f.nodeName.toLowerCase());)f=f.parentNode;f&&(!f.target&&!a.shiftKey&&!a.altKey&&!a.ctrlKey&&!a.metaKey)&&(KM.pdft(a),setTimeout(function(){document.location=f.href// <---- redirection to the actual image},250))})})};
This event handler logs the click and redirects to the actual image location.
This bypasses the event handler of the lightbox which uses e.preventDefault() to prevent the click on the image to redirect to the actual image location.
The wordpress plugin should not attach this event to lightbox'd links.
I spend several hours on finding a way for bypassing this problem but the fact that the script uses setTimeout(..., 1) to add non-blocking script tags made it nearly impossible to find a reliable workaround.
While I've never developed with Wordpress (I'm coming from Drupal/node.js) I can guess that this problem might be quite hard to solve even when modifying the plugin.
I wanted to leave a report with my experience here anyway.
For now we ended up disabling the Setting in the kissmetrics module options.
Thanks!
The text was updated successfully, but these errors were encountered:
When using Lightboxes with the KISSmetrics -> General tracking -> Links in posts/pages setting active I'm experiencing the following issue:
The Lightbox opens for a second then it redirects me to the URL of the actual Image.
This is caused by the "trackClickOnOutboundLink" event handler which is attached to all links within the post/page when the setting is active.
This event handler logs the click and redirects to the actual image location.
This bypasses the event handler of the lightbox which uses e.preventDefault() to prevent the click on the image to redirect to the actual image location.
The wordpress plugin should not attach this event to lightbox'd links.
I spend several hours on finding a way for bypassing this problem but the fact that the script uses setTimeout(..., 1) to add non-blocking script tags made it nearly impossible to find a reliable workaround.
While I've never developed with Wordpress (I'm coming from Drupal/node.js) I can guess that this problem might be quite hard to solve even when modifying the plugin.
I wanted to leave a report with my experience here anyway.
For now we ended up disabling the Setting in the kissmetrics module options.
Thanks!
The text was updated successfully, but these errors were encountered: