Hi, my problem is related to Error NS_BINDING_ABORTED, events are not send - #4 by Denis.
We track link_clicks with stape tag. Right after the event is triggered, the user (of course) navigates to a new page.
We see that very often the stape xhr-call is being cancelled (status cancelled in network tab). Also the event doesn’t reach the server. Sometimes the event is tagged as cancelled in the network tab, but still reaches the server.
We did not find a solution for this problem. But our data is inaccurate. Any ideas?
Hi @simon_reu,
This problem is a classic one.
There are 2 possible feasible solutions:
-
Use the Use fetch instead of XMLHttpRequest (for POST requests only) option for the link_click events. Sometimes you might still see the event being cancelled in the Network tab, however, the browser is still trying to send the request under the hood using some other mechanisms specifically designed for cases like this, trying to ensure that it will be delivered to the server even if the page is being unloaded.
Bear in mind that, if on sGTM these link_click events fire tags that set cookies or produce 3rd party cookie syncing requests back to the browser, they won’t work because the request won’t be processed by the browser.
-
A more complicated approach that only works if the next page after the click is controlled by you.
Instead of firing the link_click event when the action occurs, you save the information in a cookie or Storage (localStorage or sessionStorage) and fire the tag on the next page using this saved information.