There are a few simple steps to install the agent on the site.
To begin with, you should have received a Burt script URL from us. It
looks like this, where site
is the name of your site:
<script src="http://m.burt.io/s/site-com.js" type="text/javascript"></script>
If you have not received this yet, please contact our support
The script tag can be placed anywhere on the site, but we highly
recommend that it is placed in the <head>
-tag. The reason for this is
that when the script is placed in the <body>
-tag the data the
agent collects will not be as accurate – in some cases a script within the <body>
-tag
will never even load before the visitor navigates to a new page. The
earlier the agent is loaded, the more accurate the data will
be.
The script adds a variable on window
called burtApi
. On
window.burtApi
there is a function called startTracking
. Inside
that function’s callback, the setup takes place. Here’s an example:
window.burtApi.startTracking(function(api) {
api.setTrackingKey('KEY', 'NAME');
api.setDomain('yousite.com');
});
(Note that this code must be placed after the Burt script tag)
The site must be identified using the function
setTrackingKey. You will
receive KEY
and NAME
from us. The agent also need to know what
domain the script should run on, which is specified using
setDomain.