Basic Implementation

The first part of the two step integration with tracking, is the installation of the tracking code. Jump to documentation about the metadata tag once you have the JavaScript running!

The Tracker is a small piece of JavaScript code that monitors user actions taken on your site and relays them to the analytics server.

To get started, insert the Tracker in the footer of your website template. Ideal placement is as the last code block before the closing of the body tag. If your website uses a templating system, this is usually in the "footer" template.

<!-- START Include: Standard -->
<div id="parsely-root" style="display: none">
  <span id="parsely-cfg" data-parsely-site="##########"></span>
    (function(s, p, d) {
      var h=d.location.protocol, i=p+"-"+s,
          e=d.getElementById(i), r=d.getElementById(p+"-root"),
      if (e) return;
      e = d.createElement(s); = i; e.async = true;
      e.src = h+"//"+u+"/p.js"; r.appendChild(e);
    })("script", "parsely", document);
<!-- END Include: Standard -->

Copy and paste the code block above. Notice that there is a configuration tag (parsely-cfg) which has a data property, data-parsely-site="##########". You must replace the "##########" with the site id associated with your dashboard, e.g. "".

This ensures that no matter what host name your tag appears on, all the traffic data gets aggregated into a single account. You can get a version of the code that is already customized for your account in the dashboard

A note on staging sites and edit environments

You should never include the tracker on staging sites with production URLs in their metadata. It's possible, however, to set up a separate dashboard for your staging environment. Contact your account manager for more details.

Optimizing tracker placement

If you are curious about the optimal placement of tracker code on your website, you can take a look at this article on how tracking scripts affect page loads.

Do you have an urgent support question?