Wordpress
WordPress gives you several paths to add the snippet to every page — the theme footer, the customizer, or a lightweight code plugin. The footer approach works on any theme without extra plugins.
Add the snippet via the theme customizer
In your WordPress admin panel, go to Appearance → Customize → Additional CSS — wait, that is for CSS. For JavaScript, look for Additional Scripts or Custom HTML if your theme exposes it in the customizer. Not all themes do. If yours does, paste the snippet in the header scripts or footer scripts field and publish.
A more reliable path that works on any theme: go to Appearance → Theme File Editor (or Appearance → Editor in older WP versions). In the file list on the right, find footer.php. Look for the wp_footer() function call — it is usually near the bottom of footer.php. Paste the snippet just before the closing </body> tag or just before the wp_footer() call.
Save the file. Load any page on your site in a browser, then open your StatelessID dashboard. You should see a page view within a minute.
Using a code plugin instead of editing theme files
Editing theme files directly means your change can be overwritten when the theme updates. A safer approach is a code injection plugin — search the WordPress plugin directory for "header footer code" or "insert headers and footers." These plugins let you paste the snippet once in their admin panel and they inject it into every page on the site without modifying theme files.
With most such plugins, paste the snippet in the "Scripts in Footer" field. The plugin adds it before </body> on every page. When the theme updates, your snippet stays because it lives in the plugin's own data, not in the theme.
There is no specific plugin required — any plugin that injects arbitrary HTML into the site footer works. Choose one with recent updates and good reviews. The snippet does not need to interact with WordPress APIs, so compatibility requirements are minimal.
Child themes and block themes
If you use a child theme, edit footer.php in the child theme, not the parent. If the child theme does not have footer.php, create one by copying it from the parent theme and adding the snippet. The child theme's footer.php will override the parent's without being affected by parent theme updates.
WordPress 5.9+ introduced block themes (also called Full Site Editing themes). Block themes do not use footer.php in the traditional sense. Instead, go to Appearance → Editor → Templates → Single or Page, and add a Custom HTML block to the template before the final closing tag. Paste the snippet inside that HTML block.
Alternatively, with block themes you can use the Site Editor's template parts: find the Footer template part, switch to the Code Editor view (the three-dot menu → Code Editor), and add the snippet HTML before the last block comment.
Multisite and WooCommerce considerations
On a WordPress Multisite network, each site in the network can have its own theme and its own footer. If you want to track each network site separately, register each one in StatelessID with its own key and install the appropriate key in each site's theme footer.
If you want a single combined view across the whole network (only practical if all sites share one domain with subdirectory paths), use the same key in every theme. The dashboard will aggregate all page views under one site entry.
WooCommerce does not require special handling. The StatelessID snippet works like any other script tag on WooCommerce pages. Product pages, category pages, cart, and checkout pages will all report page views. The snippet does not intercept form submissions, payment data, or any user-entered information.
Troubleshooting
I added the snippet to footer.php but I see a blank white screen. A syntax error in footer.php breaks the entire theme rendering. Open footer.php again and look for unbalanced PHP tags or accidentally deleted template code. Restore the file from a backup if needed — the snippet should be pure HTML outside any PHP blocks.
My WordPress cache plugin is serving stale pages without the snippet. After adding the snippet, clear all caches in your cache plugin. Also purge any CDN cache if you use Cloudflare or a similar service. The snippet only runs in real browser sessions, so it needs to be in the HTML that visitors actually receive.
The snippet fires on most pages but not on WooCommerce checkout. Some security plugins or payment gateway integrations strip unrecognized scripts from the checkout page. Check your security plugin settings for any "allowed scripts" list and add the StatelessID domain, or use the code injection plugin approach which may bypass those restrictions.