Skip to content

Install Statsdot on WordPress

Updated November 7, 2026

There are three ways to add Statsdot to WordPress. The first one needs no code and also counts WooCommerce sales.

Option 1: the Statsdot plugin

  1. In your WordPress admin, go to Plugins → Add New, search for Statsdot and install Statsdot Analytics.
  2. Open Settings → Statsdot and click Connect your Statsdot account. Sign in or create an account, pick the site (or add it) and you are back in WordPress with tracking on.
  3. With WooCommerce, the plugin also sends Add to cart and Purchase with the order total, so the dashboard shows revenue per source.

Tracking stays off until you connect or turn it on. Logged-in administrators are not counted by default. Details and every option: WordPress plugin.

Option 2: a header and footer plugin

  1. In your WordPress admin, go to Plugins → Add New and install a plugin that inserts code in the header, such as WPCode.
  2. Open its Header section and paste your snippet:
<script defer data-domain="yoursite.com" src="https://statsdot.com/js/script.js"></script>
  1. Save. The script now loads on every page of the site.

Option 3: your child theme

If you use a child theme, add this to its functions.php:

add_action('wp_head', function () {
    echo '<script defer data-domain="yoursite.com" src="https://statsdot.com/js/script.js"></script>';
});

Do not edit the parent theme directly: updates would remove the change.

Caching and optimisation plugins

Plugins that combine, minify or delay JavaScript (WP Rocket, Autoptimize, LiteSpeed Cache and others) can rewrite the script tag and lose the data-domain attribute. Add statsdot.com/js/script.js to their list of excluded scripts, then clear the cache.

Logged-in users

WordPress admins visit their own site a lot. To leave your visits out, open your site, open the browser console and run localStorage.setItem('statsdot_ignore', '1') once in each browser you use.

Check that it works

Visit your site in a private window and look at the dashboard: you should appear among the visitors on the site right now within a few seconds.