INSTRUCTIONS FOR TRACKING AN APP
-
After creating an account on the Blocmetrics site, Log In
-
On the dropdown menu on the navigation bar, click on ‘Add App’
-
Enter a name and url for the web application you wish to track (you can enter any name you like) and click ‘save’
-
Once the app is registered, copy the following snippet and place it in the ‘application.html’ file on the site, before the </head> tag:
<script>
(function (){ var _bm_event = { name: "Event name" } var _bm_request = new XMLHttpRequest(); _bm_request.open("POST", "http://localhost:3000/api/events", true); _bm_request.setRequestHeader('Content-Type', 'application/json'); _bm_request.onreadystatechange = function() { }; _bm_request.send(JSON.stringify(_bm_event)); }());
</script>