Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

jenhaines/metrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##Metrix

####A general purpose analytics service that tracks events on your website

  • a client-side Javascript snippet that allows a user track events on their website*
  • a server-side API that captures and saves those events to a database*
  • a Rails application that displays the captured event data for a user.

#####How to setup Metrix to track events on a website

  • Sign up for a free account at the Metrix website.
  • Create a profile for the application.
  • Insert the generated Javascript code in your website

#####Javascript code needed to track events with Metrix

Put this Javascript function in your code so your objects can access it globally.

  function send_event(_bm_event){
    var _bm_request = new $.ajax({
      url: "https://metrix-jh.herokuapp.com/api/events.json",
      method: "post",
      data: {event: _bm_event}
    })
  }

_bm_event takes four variables.

app_id: unique id for each app (WILL NOT WORK WITHOUT IT)

name: Name you choose for the event

action_1: One of two action variables that can be sent to Metrix

action_2 Second action variable that can be be sent to Metrix

#####Sample code of an onclick Javascript call

onclick="send_event({app_id: 42, name: 'example.com', action_1: 'homepage', action_2: 'mailto link clicked'})"

That's it.

Your events are then being sent to Metrix where it can be viewed in many different charts and graphs to fit your needs.

Heroku preview

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors