The Problem
From a naive perspective, it is not possible for a web page from domain D, to access a URL from another domain E due to security considerations. Several workarounds have been developed, namely the remote script technique. All existing workarounds suffer from significant limitations, such as the unhampered ability to read and write between two different domains.

The Short
Say domain D wants to connect to domain E. In a nutshell, the trick is to use DNS to point a sub-domain of D, D_s, to Eâ€™s server. In doing so, D_s takes on the characteristics of E, while also being accessible to D.

This technique seems to require that JavaScript allow passing of information between subdomains. In my experience, Javascript currently doesn’t allow for this to happen. You can’t have x.example.com open an iframe with y.example.com and pass data both ways. (If I’m wrong and there is a way for this to be done, I’d be very interested in it as it would simplify a project I’m working on.)

I am wondering how Google analytics make this? They doing for sure because what they do is only contain an Javascript include and an Javascript function and that’s it. After this they collect thatever they can – and they do this. :)