This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.document | Thu Aug 13 08:55:22 -0700 2009 | |
| |
.gitignore | Thu Aug 13 08:55:22 -0700 2009 | |
| |
LICENSE | Thu Aug 13 08:55:22 -0700 2009 | |
| |
README.rdoc | Thu Aug 13 17:17:15 -0700 2009 | |
| |
Rakefile | Wed Oct 14 07:32:36 -0700 2009 | |
| |
VERSION | Wed Oct 14 07:41:44 -0700 2009 | |
| |
lib/ | Wed Nov 04 08:55:34 -0800 2009 | |
| |
rack-google_analytics.gemspec | Wed Nov 04 08:55:34 -0800 2009 | |
| |
test/ | Wed Nov 04 08:55:34 -0800 2009 |
README.rdoc
Rack::GoogleAnalytics
Rack middleware to embed Google Analytics tracking code.
Usage
require "rack/google_analytics"
use Rack::GoogleAnalytics, :web_property_id => "UA-000000-1"
app = lambda { |env| [200, { 'Content-Type' => 'text/html' }, '<html><body></body></html>'] }
run app
Configuring for a Rails App
config.gem "ambethia-rack-google_analytics", :lib => "rack/google_analytics", :source => "http://gems.github.com" config.middleware.use "Rack::GoogleAnalytics", :web_property_id => "UA-0000000-1"
TODO and Motivations
This isn’t very "feature rich", because I’ve mostly written it as an excuse to learn more about rack. Hell, it’s possible someone has already done it (and better); I didn’t bother to look. See the notes below on contributing fixes for these deficiencies.
- Support for the various tracking options (code.google.com/apis/analytics/docs/gaJS/gaJSApi.html)
- Legacy tracking code
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don’t break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
- Send me a pull request. Bonus points for topic branches.
Copyright
Copyright © 2009 Jason L Perry. See LICENSE for details.







