Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A simple library to add (configurable) KISSmetrics to your layouts
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
nbproject
rails
spec
.document
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.rdoc
Rakefile
VERSION
example_kissmetrics.yml
simplekiss.gemspec

README.rdoc

simplekiss

This is a simple library to add KISSmetrics to your layouts. It is configured using a YAML file.

Install

gem install simplekiss

Configure

Create a kissmetrics.yml file in your app's config/ dir

#KISSmetrics configuration file.
---
apikey: <enter your api key here>

<controller>:
  <action>: 'kissmetrics step title'
  <another action>: 'kissmetrics step title'

# Example usage
user:
  new: 'Visit signup page'
  show: 'Viewed account page'
post:
  new: 'Create a new post'

This allows you the customise the name of the action based on the controller and action being called

Adding KISSmetrics to your layout

Simply add this to the end of your layout, preferably the last thing before <body>

<%= kissmetrics if Rails.env == 'production' %>

By default, if an entry isn't found '<controller name>/<action name>' is sent to KISSmetrics instead. If you want to turn off this behaviour, to stop polluting you stats with every page:

<%= kissmetrics(use_defaults=>false) if Rails.env == 'production' %>

TODO/Feedback

  • Tests: yeah, I know. Feel free to help me out here

Copyright

Copyright © 2010 Jamie Lawrence. See LICENSE for details (MIT licence).

Something went wrong with that request. Please try again.