Rails and Google Analytics

Has anyone successfully configured Google Analytics to work with a
Rails application? I have tried included the Javascript in one of my
layouts and Google Analytics still says:

" Tracking Unknown (Last checked: 2006-09-12 7:16 PM PST.)
The Google Analytics tracking code has not been detected on your
website’s home page. For Analytics to function, you or your web
administrator must add the code to each page of your website."

I was able to set it up successfully with some static HTML pages, so
I’m assuming it’s Rails?

Thanks
Tony

Included in the second should be including, sorry for the typo.

Tony

Not a Rails bug. Google Analytics works fine with anything that
includes
its javascript in the of the HTML. Make sure you have the right
value in your _uacct field and that when you load the page from a
browser
it shows up.


Thanks,
-Steve
http://www.stevelongdo.com

Is your site publicly accessible? I think google first needs to ‘ping’
your site to ‘activate’ it.

TeeC wrote:

Has anyone successfully configured Google Analytics to work with a
Rails application? I have tried included the Javascript in one of my
layouts and Google Analytics still says:

" Tracking Unknown (Last checked: 2006-09-12 7:16 PM PST.)
The Google Analytics tracking code has not been detected on your
website’s home page. For Analytics to function, you or your web
administrator must add the code to each page of your website."

I was able to set it up successfully with some static HTML pages, so
I’m assuming it’s Rails?

Thanks
Tony

Are you running it locally or on a production box? Google Analytics only
accepts data from the specific host name you supplied.
http://localhost:3000 is probably not what you told it to track.

Actually Google recommends including their javascript at the very end
of the page:

from
http://www.google.com/support/analytics/bin/answer.py?answer=26908&topic=7325:

“Copy and paste the code segment into the bottom of your content,
immediately before the tag of each page you are planning to
track. If you use a common include or template, you can enter it
there.”

We’re using analytics with our Rails app, it rocks.

John

I’ve used http://woss.name/2006/05/09/google-analytics-plugin/ and been
very impressed with it. It will only insert the google tracking code
when the rails app is in production mode.

Sorry for forgetting to respond to my own topic. Just thought I would
say that I fixed the Google Analytics problem, their was a simple
syntax error in my Google Analytics code. Should have looked harder

_<.

Thanks,
Tony

You have to be careful with Google analytics, I have heard that Google
raised the bid amounts for
publishers who were having a good conversion ratio.

We’re using analytics with our Rails app, it rocks.

Just an FYI that yahoo has a similar product in beta:

http://publisher.yahoo.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs