We’re excited to announce we’ve released into beta a JavaScript library for StatsMix. The new library provides a quick and easy way to track any action or event on a website. Use this to track page views, conversions, downloads, or just about anything else you can think of.
Using our JavaScript library, a metric’s value (along with any metadata) will be sent to StatsMix every time a page loads.
To use it, you’ll just need to follow these steps:
- Create a new custom metric in StatsMix
- Copy/paste the JavaScript sample code to send a new data point to StatsMix:
- Paste this script on any page you wish to track
<script type="text/javascript">; var sm_token = 'METRIC_TOKEN'; // the metric token will be populated for you var sm_value = 1; // replace sm_value with any numeric value. var sm_meta = ''; /* to add metadata, assign a JSON object to the variable sm_meta: var sm_meta = {'food':'ice cream','flavor':'chocolate'}; */ var sm_prefix = document.location.protocol == 'https://' ? 'https://' : 'http://'; document.write(unescape('%3Cscript src="' + sm_prefix + 'http://statsmix.com/stat.js" type="text/javascript"%3E%3C/script%3E')) </script>;
If you’re interested in using the JavaScript library during beta, please contact us. If you don’t already have a StatsMix account, you can sign up for one here.