Install FastAnalytics on WordPress
No dedicated plugin needed: WordPress only has to print one line in the head of every page.
Option A: a header-code plugin (recommended)
- In WordPress, go to Plugins > Add New and install a header and footer code plugin, such as WPCode.
- Open the plugin's header and footer settings.
- Paste your FastAnalytics script in the Header box.
- Save. Open your site and check Realtime in your dashboard.
<script>window.hm=window.hm||function(){(window.hm.q=window.hm.q||[]).push(arguments)};</script>
<script defer src="https://e.fastanalytics.site/e.js" data-id="FA-XXXXXXXXXX"></script>Option B: in your child theme
If you use a child theme, add this to its functions.php. Do not edit the parent theme: updates would erase the change.
add_action('wp_head', function () {
echo '<script>window.hm=window.hm||function(){(window.hm.q=window.hm.q||[]).push(arguments)};</script>' . "\n";
echo '<script defer src="https://e.fastanalytics.site/e.js" data-id="FA-XXXXXXXXXX"></script>' . "\n";
});Caching and optimisation plugins
- After installing, clear your cache (WP Rocket, LiteSpeed Cache, W3 Total Cache, Cloudflare…).
- If an optimisation plugin combines or delays JavaScript, exclude
e.fastanalytics.site/e.jsfrom those options.
Visits from logged-in administrators are counted like any other. To exclude your own visits, see Check your installation.
FAQ
Does it work with WooCommerce?
Yes. The script measures every page, including product, cart and checkout pages. Use custom events to count purchases or sign-ups.
Keep reading
Install the FastAnalytics tracking scriptHow to add FastAnalytics to any website in two minutes: get your FA code, paste one line before the closing head tag and check that visits arrive in real time.Read →3 minTrack custom events: sign-ups, purchases, clicks and outbound linksCount the actions that matter with FastAnalytics: hm() in JavaScript, the data-hm attribute without code, and automatic outbound, WhatsApp, email and phone clicks.Read →4 minCheck your installation and fix missing visitsHow to check that FastAnalytics is working, why visits might not appear (domains, ad blockers, caching, Content Security Policy) and how to exclude your own visits.Read →4 min