Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 927 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 927 Bytes

Blocmetrics

An analytics service and reporting tool that you can use with web apps to track user activity and report results.

  1. Create an account at Blocmetrics and add your website url you want to track.

Now, suppose we wanted to track page visits.

  1. Add the following code to your site (either a new .js file or in <script> tags:
var blocmetrics = function(page_views) {
	var _bm_event = {
	event_name: page_views,
	}

	var _bm_request = new XMLHttpRequest();
	_bm_request.open("POST", "http://blocmetrics-austin.herokuapp.com/api/events", true);
	_bm_request.setRequestHeader('Content-Type', 'application/json');
	_bm_request.onreadystatechange = function() {
	};
	_bm_request.send(JSON.stringify(_bm_event));
};

$(document).ready(function(){
    blocmetrics(window.location.pathname);
  })
  1. Visit your Blocmetrics Application page to see the live results!