# Googla Analytics and RJS

**URL:** <https://www.ruby-forum.com/t/googla-analytics-and-rjs/185718>\
**Category:** Rails\
**Created:** [March 25, 2010, 3:47am UTC](https://www.ruby-forum.com/t/googla-analytics-and-rjs/185718 "2010-03-25T03:47:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f17d59/32.png) [@Nicholas\_W](https://www.ruby-forum.com/u/Nicholas_W)\
**Post date:** [March 25, 2010, 3:47am UTC](https://www.ruby-forum.com/t/googla-analytics-and-rjs/185718/1 "2010-03-25T03:47:39Z")

</div>

Hi guys, I’m trying to make google Analytics track an action that  
updates the view via AJAX.  
What I did is:

page.call ‘pageTracker.\_trackPageview’, ‘/votes/create’ if Rails.env ==  
‘production’

but for some reason it doesn’t actually work. Someone already solved the  
same problem ?

ngw

---

<div class="post-metadata">

**Author:** ![Nicholas\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f17d59/32.png) [@Nicholas\_W](https://www.ruby-forum.com/u/Nicholas_W)\
**Post date:** [March 25, 2010, 5:00am UTC](https://www.ruby-forum.com/t/googla-analytics-and-rjs/185718/2 "2010-03-25T05:00:14Z")

</div>

On Wed, 2010-03-24 at 19:46 -0700, Nicholas W. wrote:

> Hi guys, I’m trying to make google Analytics track an action that updates the view via AJAX.  
> What I did is:
> 
> page.call ‘pageTracker.\_trackPageview’, ‘/votes/create’ if Rails.env == ‘production’
> 
> but for some reason it doesn’t actually work. Someone already solved the same problem ?

* * *

yup - I had a thread on this topic earlier this month… My final  
solution was posted on March 8th. There was some discussion and you may  
or may not like my solution.

See topic titled “[Rails] Google Analytics and partials”

Craig

–  
This message has been scanned for viruses and  
dangerous content by MailScanner, and is  
believed to be clean.
