Login to the Autochart portal and get the Tracking Key from your account's settings page.
This is the recommended approach if you are building the tracking implementation yourself rather than having the Autochart dev team implement it for you.
Add the following snippet immediately before the closing
</head> tag on each page of your site. It will download the
autochart.track.min.js file asynchronously from the Autochart CDN (so it will be fast and won't block your page from loading in the meantime).
Make sure to update
<YourCustomerAccountIdHere> with your account's Tracking Key.
To reference the library as part of a commonjs style package, first install it:
npm install autochart-tracker --save
then import it:
var acTracker = require('autochart-tracker'); acTracker.init('<YourCustomerAccountIdHere>');
Add calls to
autochart.track* functions to send event data to Autochart.
If you need to disable tracking on a website which already has Autochart tracking hooks in place, you should insert the following line of code at the top of your tracking snippet (as the first line inside your
windowAUTOCHART_DISABLED = true;
This will prevent any events from being sent to the Autochart servers.
Check out the wiki for more details on building a tracking implementation with Autochart.
If you need help with anything, drop us an email at email@example.com and we'll be happy to help out.
The sections below are for developers working on this library.
To run tests for this library:
Open browser to http://localhost:8080/test. This will run the mocha tests in the browser.