Installation

WordPress Plugin

Install Sonar on WordPress with the official plugin or a header snippet.

  1. Download the plugin (sonar-analytics.zip). Don't unzip it.
  2. In your WordPress admin, go to Plugins → Add New and click Upload Plugin.
  3. Choose the zip file, click Install Now, then Activate.
  4. Go to Settings → Sonar Analytics and paste your Site Key. In Sonar, you'll find it under Site settings → Tracking code (choose the WordPress tab).
  5. Click Save settings.

To update the plugin later, download the latest zip and upload it the same way; WordPress offers to replace the installed version.

The plugin adds the tracking code to every page, and it keeps working when you change themes. By default it doesn't count logged-in administrators and editors, so your own browsing doesn't skew your numbers. Check in a private window to see your visit arrive.

Option 2: Add the snippet yourself

If you can't install plugins (some managed WordPress hosts restrict them), add the snippet to your theme instead.

Use a header/footer plugin such as WPCode, or edit your child theme's header.php. Paste this before </head>:

<script async src="https://sonar-app.co.uk/tracker.js" data-site-key="YOUR_SITE_KEY"></script>

Note: Edits to a parent theme's header.php are lost when the theme updates. Use a child theme or a plugin.

Caching plugins

If you use WP Rocket, W3 Total Cache or similar, clear the cache after installing so the snippet appears on cached pages.