How to add the Painless Analytics script

To start tracking activity on your website, you will need to place a script block ( code) within the HTML of each page. This code is unique per website, so we can associate the web traffic with the correct site. You’ll first need to set up your website and hostname(s).

To set up your unique Painless Analytics tracking script:

  1. Sign into Painless Analytics
  2. Navigate to the Analytics Dashboard; select which website you are configuring.
  3. Select “Settings”.
  4. Copy the provided code under “Embed Tracking Code”. You can click the clipboard button in the top right to quickly copy the entire block.
  5. Place this code in your HTML pages just below the <head> tag.
  6. Save and deploy/publish your site. That’s it!

Note: You’ll need the script block on every page you want to track, so it’s recommended to put in a shared layout component / template. If you have more than one layout, don’t forget to add to each one!

Tip: If you use WordPress for your site, you can use the Painless Analytics WordPress Plugin to easily add your script to all pages, without needing to edit the pages manually!

To top