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 thelink_clickevents. 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 theselink_clickevents 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 thelink_clickevent 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.
