mitamirri

Mitamirri is a Rails engine designed to be a drop-in substitute for (or companion to) Google Analytics that allows tracking of custom user events at a very granular level (e.g. specific link or button clicks and even mouseovers) in addition to the standard visits, etc.

Installation

  • Add the following lines to your config/environment.rb file:

    config.gem 'mitamirri'
    
  • Add this to the top of your app/helpers/application_helper.rb file:

    include Mitamirri::Helper
    
  • To install the necessary files into your application, run:

    rake mitamirri:install
    
  • If you want to override default behaviour (strongly recommended, to at least require authorization for accessing reports), run the following rake command to copy Mitamirri’s views and controllers to your application for customization:

    rake mitamirri:override
    
  • Include Mitamirri’s CSS in your admin layout:

    <link href="/stylesheets/mitamirri.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/stylesheets/mitamirri_print.css" media="print" rel="stylesheet" type="text/css" />
    

Configuring Tracking

  • To track pageviews, add this anywhere in the HTML body of your view (or layout) file:

    <%= track_action 'view' -%>
    
  • To track scroll events, add this:

    <%= track_action 'scroll' -%>
    
  • To track mouseovers, add the DOM element ID and a custom label:

    <%= track_action 'mouseover', :observe => 'my_element_id', :label => 'My Label for This Action' -%>
    
  • To track click events, add the DOM element ID and a custom label:

    <%= track_action 'click', :observe => 'my_element_id', :label => 'My Submit Button Pressed' -%>
    
  • To track conversions, add the DOM element ID and an optional custom label:

    <%= track_action 'conversion', :observe => 'my_element_id', :label => 'Contact Form Submitted' -%>
    
  • To track clickthroughs to other sites, add the DOM element ID and an optional custom label:

    <%= track_action 'clickthrough', :observe => 'my_link_id', :label => 'Link to CorporateSite.com' -%>
    

Accessing Reports

To view reports and session details, point your browser to localhost:3000/admin/tracking/

Development Tips

  • To run specs, use rspec spec/

  • If you add features, run rake version:bump:minor to adjust the version number accordingly.

  • If you’re just fixing bugs, run rake version:bump:patch instead.

Copyright © 2010 Corey Ehmke / SEO Logic. All rights reserved.