I'm trying to write a script that will be loaded from one server into a website on another server. This script is trying to talk (ajax) to the server that it comes from but I'm getting "Access Denied" errors.

I'm well aware that cross-domain calls are not allowed for security reasons so my question is how does Google Analytics work because essentially thats what I'm trying to accomplish.

I can embed a Google Analytics script into my website and it'll gather data and send it back to Google. Wondering how they do it?

Help is much appreciated.