How to create a tracking script with js and php?
<p>I want to create a simple tracking script to give to my clients. Something similar with GA but very basic.</p>

<p>The requirements are 
<li> give the clients a single and simple js script like google Analytics does
<li> make most of the logic inside the js file loaded by 3th party sites from the main site
<li> collect in PHP the information and store it</p>

<p>What I can't figure yet is what are the ways to do this?
Google from what I see is loading a gif file, stores the information and parses the logs.
If I do something similar sending the data to a php file Ajax cross site policy will stop me, from what I remember.</p>

<p>So what is a clean way to do this ? ( I don't need code  just the logic behind it )</p>
