# Working with Google Analytics

**URL:** <https://www.ruby-forum.com/t/working-with-google-analytics/132946>\
**Category:** Ruby\
**Created:** [March 26, 2008, 1:37am UTC](https://www.ruby-forum.com/t/working-with-google-analytics/132946 "2008-03-26T01:37:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [March 26, 2008, 1:37am UTC](https://www.ruby-forum.com/t/working-with-google-analytics/132946/1 "2008-03-26T01:37:39Z")

</div>

Hi Guys,

Thanks for your help earlier.

My company, [Pilotoutlook.com](http://Pilotoutlook.com) is close on the heels of launching our  
first  
APIs - AirportLookup (shameless plug - it is going to be the largest  
Airport  
DB)  
and I want to track the requests coming in through Google Analytics.

My idea is that if somehow, I can call Urchin JS in the background (from  
controller), I should be able to register it as a visit.

Note that we are rendering XML as the output of the controller and also,  
I  
don’t want to add ~300ms to every response (so some asynchronous call  
will  
be great)

Is this a possibility or am I smoking pot? If so, how do I do it?

I know we can do using log parsing but it is just too many places to  
look  
for the data at that point of time.

Please let me know

Thanks,

–  
Rajat G.

Ph: 206-499-9495  
Add: 1314 Spring Street, #412  
Seattle, WA 98104  
Web: [http://www.pilotoutlook.com](http://www.pilotoutlook.com)

---

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [March 26, 2008, 2:15am UTC](https://www.ruby-forum.com/t/working-with-google-analytics/132946/2 "2008-03-26T02:15:45Z")

</div>

You’re going to need to make the call from the client IP, and unless you  
require that front end code from your side runs in the end user’s  
browser that won’t happen. You might try something like the site  
statistics gem and perhaps customize it for your needs. Granted, google  
Analytics is way cooler. However, storing your own log data depending on  
your storage capabilities might actually open you up to more analysis  
potential later.  
Sent wirelessly via BlackBerry from T-Mobile.
