Link calls on anchor tag not firing.

Silver Contributor
Silver Contributor

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

 

 

5 REPLIES 5

Link calls on anchor tag not firing.

Employee Emeritus

@rushikesh_naik,

 

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.

Link calls on anchor tag not firing.

Tealium Employee

@rushikesh_naik

 

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

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

Link calls on anchor tag not firing.

Silver Contributor
Silver Contributor
Our dev teams many not be open to introducing delays for analytics tagging. Thank you for the reply.

Link calls on anchor tag not firing.

Tealium Employee

@rushikesh_naik

 

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

 

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

Link calls on anchor tag not firing.

Gold Contributor
Gold Contributor
@rushikesh_naik

In addition to the above @adrian_browning summarized points. Here is the link which you can check the version of jQuery (in website) before adding the extension on jQuery under "Events Tab".

https://community.tealiumiq.com/t5/Productivity-Tools/Determine-Version-of-jQuery-on-a-Site/ta-p/511...

Public