Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rails GA plugin fork w/ using newer GA tracking code
Ruby
Branch: master
Pull request Compare This branch is 69 commits behind rubaidh:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/rubaidh
test
README
Rakefile
init.rb

README

GoogleAnalytics
===============

This is a quick 'n' dirty module to easily enable Google Analytics support
in your application.  By default it'll output the analytics code for every
single page automatically, if it's configured correctly.  This is done by
adding:

    Rubaidh::GoogleAnalytics.tracker_id = 'UA-12345-67'

to your `config/environment.rb`, inserting your own tracker id. This can be
discovered by looking at the value assigned to +_uacct+ in the Javascript
code.

If you want to disable the code insertion for particular pages, add the following to controllers that don't want it:

    skip_after_filter :add_google_analytics_code

Simple. :-)

NOTE

This version of the plugin uses the new Google Analytics code (ga.js) by
default.  To use the legacy tracking code add the following line to your
`config/environmet.rb`:

    Rubaidh::GoogleAnalytics.legacy_mode = true
Something went wrong with that request. Please try again.