views:

629

answers:

1

I am looking for a way to implement Google Analytics tracking in my web service. My app sends and receives XML from the server, so implementing the Google JavaScript tracking stuff is unfortunately no option.

Any other alternatives? Someone must have done this before :-)

A: 

Hey Ed,

Have you heard of HeartBeatApp? It's an Objective-C plugin that provides fine-tuned metric tracking specifically for iPhone applications. Check it out here:

http://www.heartbeatapp.com/

I'm using it in two applications now, and in my opinion it is the best "plug-and-play" style solution for tracking app usage and metrics.

If you are set on integrating Google Analytics, you'll need to run their JavaScript in an HTML page somewhere in your app. My approach would be to place a secret/hidden UIWebView on each app page screen, and programmatically load a static HTML page just for tracking in the background on each screen load.

Hope that helps.

-Mark

Mark Hammonds
Hi Mark,thanks for your comment!My app is no iPhone app and unfortunately also a background service, so the hidden UI approach is probably also not really suitable in this case.I already thought about "spoofing" the request on the serverside, but that would be a really ugly hack and probably very bad from a performance point of view :-/What are all the other webservices devs doing in those situations? :)--Ed
Ah, I see. I misunderstood your options then. Could you possibly generate two HTTP calls simultaneously? One for the HTML page with the tracking code and one for the XML feed? Alternatively, could you just analyze access logs or build some sort of custom tracking into a dynamic script that then generates the XML?
Mark Hammonds