Q: Does a proxy needed for a cross domain Ajax call if no return is expected? I have a tracking system sending Ajax Call to a remote server in JavaScript. No return values from the server is expected.
This is the Ajax call :
window.onbeforeunload = function () {
    $.ajax({
       url: "https://remoteURL.com/r/",
       type: "get",
       async: false,
       xhrFields: {
          withCredentials: true
       },
       data: {
          tagid: "123"  
       }
    }).done(function () {
       console.log("sent");
    });
};

Google Chrome show that the request was successfully sent :

The problem is that I didn't get the sent console log, but this error:
Failed to load https://remoteURL.com/r/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://myWebSite.com' is therefore not allowed access.

I have no access to the external server, so I cannot change the header.
If I'm not expecting any return from the remote URL called in Ajax, is this code still functional despite the error thrown in console regarding the cross domain policy ? 

A: Access-Control-Allow-Origin is a restriction made by browsers, so the request was not sent. To do that kind of tracking (without sending the request from a server) you could use ping attribute of <a>  like this:
<a href="https://example" ping="https://example/trackpings">

That ping send a void post request to https://example/trackpings in this case.
