- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
Hello,
I have few anchor html elements (<a hfref="" target="" id="" />
which have target="_self" and href="/previouspage.html". We have created a jQuery OnHandler which triggers a "link" event on "mousedown" for these anchor elements.
The utag.link call is firing intermetently . If we right click this anchor elements, the view call is fired as required, but when we click it, no view call is fired occationally.
Using fidder we determined link call had a status "abort session".The fiddler calls had
"x-abortedwhen:sendingResponse" as one of its property value.
Utag version :4.39
Is there a solution to this?
Thank you,
Rushikesh Naik
06-09-2016 07:26 PM - edited 06-09-2016 07:26 PM
What version of jQuery is your site using (i.e. below or above 1.7)? Make sure you are using the correct jQuery extension as we have (2) of them.
One for jQuery versions 1.6 and below. Another one for jQuery versions 1.7 and above. Both use different jQuery methods.
So the issue you are seeing is common in modern borwsers.
The request that is being sent is being cancelled by browser as it navigating from the page.
This was introduced by browser vendors to speed up page unloading.
The only way to really deal with this is to do something like:
jQuery("img").one("click", function(event) { event.preventDefault(); console.log("test 1"); (function(link) { setTimeout(function() { jQuery(link).trigger("click"); }, 300); }(this)); });
This will prevent the page from navigating, wait and then redirect to where the link was going.
Adrian
So there are maybe 2 other options, depending on your setup.
1) Store the link in a cookie/LocalStoreage, and then on the next page fire the request.
2) Make sure the tag that you are wanting to fire has been loaded.
Make sure to set the jQuery handler to "mouse down" (this will fire the event slightly quicker.)
I hope this helps. It may be worth raising a support ticket:
https://community.tealiumiq.com/t5/custom/page/page-id/support-contact-form
To get an engineer to look at your Tealium configuration and also your site.
Adrian
Copyright All Rights Reserved © 2008-2023