Installation guides
WordPress
Add Calmstats to a WordPress site with a header plugin or your theme.
With a plugin
- In WordPress, go to Plugins → Add New and install a header and footer plugin, such as WPCode.
- Open the plugin's header section and paste the script:
index.html<script defer data-website-id="YOUR-SITE-ID" src="https://calmstats.com/script.js"></script>
- Save. The script now loads on every page.
In your theme
If you edit your theme, paste the script just before </head> in header.php, or add it from your child theme's functions.php:
functions.phpadd_action('wp_head', function () { echo '<script defer data-website-id="YOUR-SITE-ID" src="https://calmstats.com/script.js"></script>'; });
Caching and optimization plugins can delay or combine scripts. If visits don't show up, exclude script.js from minification and delayed loading.