ckib16 / QuickMetrics

QuickMetrics is an analytics service clone of BlocMetrics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QuickMarks

QuickMarks is an analytics app for web projects. It helps you track events on your websites. It is built using Rails, Devise, and a few charting libraries.

Quickmarks analytics offers a few key features:

  • A client-side JavaScript snippet that allows a user to 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

Installation

Here's how you track your website with Quickmarks:

Follow readme steps in https://github.com/mkolenda/priviametrics Step 1: Include loading of the JS file in the app's HTML header

<head>
  <script src="//quickmetrics.herokuapp.com/quickmetrics.js"></script>
  ...other tags...
</head>

Step 2: call quickmetrics function in app Add custom code for linl tracking from lunametrics

// Generated by LunaMetrics at http://buff.ly/12bFTwk
// Place Google Analytics tracking code here, or in a .js file

$(document).ready(function() {

	$("a").each(function() {
		var href = $(this).attr("href");
		var target = $(this).attr("target");
		var text = $(this).text();
		$(this).click(function(event) { // when someone clicks these links
			event.preventDefault(); // don't open the link yet
			_gaq.push(["_trackPageview", href]); // create a dynamic pageview
			setTimeout(function() { // now wait 300 milliseconds...
				window.open(href,(!target?"_self":target)); // ...and open the link as usual
			},300);
		});
	});

});

Usage

TODO: Write usage instructions

To test locally via curl with local app running on localhost:4000

curl -v -H "Accept: application/json" -H "Origin: http://localhost:4000" -H "Content-Type: application/json" -X POST -d '{"event": {"name":"test_report"}}' http://localhost:3000/api/events

To test on production apps

curl -v -H "Accept: application/json" -H "Origin: https://groupthink16.herokuapp.com" -H "Content-Type: application/json" -X POST -d '{"event": {"name":"test_report"}}' https://quickmetrics.herokuapp.com/api/events

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

Version 0.1 (2015-05-23) - adding Devise and core Rails functionality

Credits

Lead Developer - Chris Kibble (@ckib16)
Mentor - Chris Beck (@christopherbeck)

License

The MIT License (MIT)

Copyright (c) 2015 Chris Kibble

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

QuickMetrics is an analytics service clone of BlocMetrics


Languages

Language:Ruby 63.1%Language:HTML 26.6%Language:CSS 7.1%Language:JavaScript 2.4%Language:CoffeeScript 0.8%