You could do all that without involving the world's largest advertising corporation. Use the data you already receive with each request. You know, count how many pages you've served, use a GeoIP database on visitors' IP addresses, parse their user agents, all that kind of stuff.
A lot of relevant interactions in modern apps are client based. You'd have to send those data points via ajax, but then you've just recreated google analytics.