An analytics service and reporting tool that you can use with web apps to track user activity and report results.
- Create an account at Blocmetrics and add your website url you want to track.
Now, suppose we wanted to track page visits.
- 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);
})
- Visit your Blocmetrics Application page to see the live results!