Stickybeak Docs Dashboard Get early access

Websites and builders

WordPress

WordPress analytics with Stickybeak tracks every page and conversion goal through WPCode or a child theme. It is a lighter alternative to Google Analytics for WordPress and takes about five minutes, plus a cache check.

Before you start

WordPress.com needs a paid Personal, Premium, Business or Commerce plan for plugins. Self-hosted WordPress works on any host.

Add the script

  1. Install WPCode

    Go to Plugins → Add New Plugin, search for WPCode, then Install Now → Activate.

  2. Add the header code

    Open Code Snippets → Header & Footer → Header and paste:

    <script
      defer
      data-site="YOUR_SITE_ID"
      data-domain="example.com"
      src="https://app.usestickybeak.com/_cfw/s.js"
    ></script>
  3. Save and clear caches

    Do not use a widget or Custom HTML block; it loads only where that block appears.

Use a child theme instead

Add this to the child theme's functions.php; parent-theme edits disappear on update:

add_action( 'wp_head', function () {
	?>
	<script
	  defer
	  data-site="YOUR_SITE_ID"
	  data-domain="example.com"
	  src="https://app.usestickybeak.com/_cfw/s.js"
	></script>
	<?php
}, 1 );

Classic themes can also use header.php before </head>. Block themes have no header.php; use WPCode, functions.php, or wp-content/mu-plugins/stickybeak.php. To omit editors, put if ( current_user_can( 'edit_posts' ) ) { return; } first inside the function.

Check it's working

Clear caches and open the site logged out in a private window. View source and search for _cfw/s.js, then follow Verify your install.

Track goals

Use ⚙ Settings → Goals → a page visit for thank-you pages. In Elementor Pro use Advanced → Attributes with data-goal|signup. A Custom HTML block can use data-goal. For Contact Form 7, put this in WPCode's Footer:

<script>
document.addEventListener("wpcf7mailsent", function () {
  window.stickybeak && window.stickybeak("contact_form");
});
</script>

See Custom goals.

Track purchases

For WooCommerce, use the WooCommerce guide. Other checkout plugins must call window.stickybeak("purchase", { revenue, currency, order_id }) on their confirmed-order page. See Revenue.

If it isn't working

Exclude _cfw/s.js from delay, combination and minification, then clear the cache:

WP RocketSettings → WP Rocket → File Optimization → Delay JavaScript execution → Excluded JavaScript Files; also exclude from combine, or add nowprocket.
LiteSpeed CacheLiteSpeed Cache → Page Optimization → Tuning: JS Excludes and JS Deferred/Delayed Excludes; remove it from JS Delayed Includes.
AutoptimizeSettings → Autoptimize → JS, CSS & HTML → Optimize JavaScript Code → Exclude scripts from Autoptimize.
PerfmattersSettings → Perfmatters → JavaScript → Excluded from Delay.
SiteGroundSpeed Optimizer → Frontend → JavaScript → Exclude from JavaScript Combination.
W3 Total CachePerformance → Minify → Advanced → Never minify the following JS files; leave it off Performance → User Experience → Delay List.
NitroPackAdd nitro-exclude, or an Excluded Resources JavaScript rule for all operations.
Jetpack BoostAdd data-jetpack-boost="ignore" when Defer Non-Essential JavaScript is on.

With Cloudflare Rocket Loader, add data-cfasync="false" before src. See Troubleshooting.