Installation

Getting started with GoSquared is as simple as installing a small JavaScript snippet to every page you'd like to track. To begin using GoSquared, paste the following JavaScript snippet into every page you'd like to track, just before the </head> tag.

You will need to replace the GSN-123456-A parameter with the token of the project you wish to track. You can find the token, along with this tracking snippet, by going to the setup guide.

The tracking code will load asynchronously and automatically track a pageview. If you'd like to change this default behaviour, and manage tracking pages manually then see Track Pageviews.

This code will optionally also load the GoSquared Live Chat widget if you have toggled Chat 'ON' in your Project Settings.

The GoSquared Analytics code should be installed on every page of your site, just before the </head> tag.

<script>
  !function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(
  arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];
  d.src='//d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.
  insertBefore(d,q)}(window,document,'script','_gs');

  _gs('your-project-token');
</script>

Remember to substitute your project token into this code.

Full Example Page

<!DOCTYPE html>
<html>
  <head>
    <title>This is my website</title>

    <!-- GoSquared Analytics Code -->
    <script>
      !function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(
      arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];
      d.src='//d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.
      insertBefore(d,q)}(window,document,'script','_gs');

      _gs('GSN-123456-A');
    </script>
    <!-- End GoSquared Analytics Code -->
  </head>

  <body>
    The rest of my website is here
  </body>
</html>