HTML / PHP Easy
Works on any static HTML site or PHP app
Sign in to statpx → Dashboard → click your site → Snippet. Copy the 16-character Tracking ID.
</body>Open your HTML template or layout file and paste the snippet just before the closing body tag. Replace YOUR_TRACKING_ID with your actual ID.
Upload your files. Visit your site — within seconds you'll see your first pageview in the statpx dashboard. Use the Verify Install button to confirm.
<!-- Place before </body> on every page -->
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>history.pushState. No extra configuration needed.WordPress Easy
Official plugin — settings page, no code editing
Click "Download Plugin" above to get statpx-analytics.zip.
Go to WP Admin → Plugins → Add New → Upload Plugin. Select the downloaded zip and click "Install Now", then "Activate Plugin".
Go to Settings → statpx and paste your Tracking ID. Click "Save Settings".
Find your Tracking ID: statpx Dashboard → your site → SnippetVisit your site — analytics will appear in your statpx dashboard immediately.
Manual installation (alternative)
// Add to functions.php or any plugin file
add_action('wp_footer', function() { ?>
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>
<?php }, 99);Shopify Easy
Paste snippet into theme.liquid or use the snippet file
Go to Shopify Admin → Online Store → Themes → ⋯ → Edit code.
Open Layout → theme.liquid. Find the closing </body> tag and paste the snippet just before it. Replace YOUR_TRACKING_ID with your actual ID.
Click "Save". Visit your store — pageviews will appear in statpx within seconds.
{%- comment -%}statpx Analytics{%- endcomment -%}
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>Next.js Easy
App Router and Pages Router supported
App Router (app/layout.tsx)
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Script id="statpx-id" strategy="afterInteractive">
{`window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';`}
</Script>
<Script src="https://statpx.com/track.js"
strategy="afterInteractive" />
</body>
</html>
)
}Pages Router (_document.tsx)
import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html>
<Head />
<body>
<Main />
<NextScript />
<script dangerouslySetInnerHTML={{
__html: "window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';"
}} />
<script src="https://statpx.com/track.js" async />
</body>
</Html>
)
}history.pushState — no extra router event listener needed.Nuxt.js Easy
Nuxt 3 client plugin or nuxt.config.ts
Option A — nuxt.config.ts (simplest)
export default defineNuxtConfig({
app: {
head: {
script: [
{ innerHTML: "window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';",
tagPosition: 'bodyClose' },
{ src: 'https://statpx.com/track.js',
async: true, tagPosition: 'bodyClose' }
]
}
}
})Option B — Client Plugin (plugins/statpx.client.ts)
export default defineNuxtPlugin(() => {
(window as any)._stid = 'YOUR_TRACKING_ID'
(window as any)._stendpoint = 'https://statpx.com'
const s = document.createElement('script')
s.src = 'https://statpx.com/track.js'
s.async = true
document.head.appendChild(s)
})Gatsby Easy
gatsby-ssr.js or gatsby-browser.js
const React = require('react')
exports.onRenderBody = ({ setPostBodyComponents }) => {
setPostBodyComponents([
React.createElement('script', {
key: 'statpx-config',
dangerouslySetInnerHTML: {
__html: "window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';"
}
}),
React.createElement('script', {
key: 'statpx-track',
src: 'https://statpx.com/track.js',
async: true
})
])
}Ghost Easy
Code injection — no theme editing required
Log in to your Ghost Admin panel and go to Settings → Code injection.
In the Site Footer text area, paste the snippet below. Replace YOUR_TRACKING_ID with your actual ID.
Click "Save". The tracking code will now appear on every page of your Ghost site.
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>Squarespace Easy
Code injection — Business plan or higher required
In Squarespace, go to Settings → Advanced → Code Injection.
Find the Footer field and paste the snippet. Replace YOUR_TRACKING_ID.
Click "Save". The snippet is now on every page of your site.
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>Webflow Easy
Project Settings → Custom Code
In the Webflow Designer, click the project name at the top → Project Settings.
Click on the Custom Code tab.
Paste the snippet into the Footer Code field. Replace YOUR_TRACKING_ID.
Click "Save Changes" then re-publish your Webflow site.
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>Wix Medium
Requires Wix Studio or Velo by Wix
Method A — Tracking Tools (simplest)
In Wix Dashboard → Marketing & SEO → Marketing Integrations → Custom Tracking Tools.
Click "+ Connect" → choose "Custom" → select "Embed a code snippet".
Set placement to "Body - end" and paste both script tags. Replace YOUR_TRACKING_ID.
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>Method B — Velo (Dev Mode)
$w.onReady(function() {
if (typeof window !== 'undefined') {
window._stid = 'YOUR_TRACKING_ID';
window._stendpoint = 'https://statpx.com';
const s = document.createElement('script');
s.src = 'https://statpx.com/track.js';
s.async = true;
document.body.appendChild(s);
}
});Framer Easy
Site Settings → Custom Code
In Framer, go to the right panel → Site Settings (gear icon).
Find the End of <body> tag field.
Paste the snippet, replace YOUR_TRACKING_ID, then re-publish your site.
<script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>Hugo Easy
Partial template — one file, works for all themes
Save the downloaded file as layouts/partials/statpx.html in your Hugo project root. Replace YOUR_TRACKING_ID.
Open layouts/_default/baseof.html (or the equivalent in your theme). Add the partial call before </body>.
Run hugo to rebuild. The snippet will appear on every generated page.
{{ partial "statpx.html" . }}
</body>
</html><script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>Jekyll Easy
Liquid include — works with any Jekyll theme
Save the downloaded file as _includes/statpx.html. Replace YOUR_TRACKING_ID.
Open _layouts/default.html and add the include before </body>.
Run bundle exec jekyll build. The snippet will be on every page.
{%- include statpx.html -%}
</body>
</html><script>window._stid='YOUR_TRACKING_ID';window._stendpoint='https://statpx.com';</script>
<script src="https://statpx.com/track.js" async></script>