Framework & CMS recipes
Install in Next.js, React, HTML, WordPress and hosted site builders.
On this page
Next.js App Router
Add one Script to your root layout. Keep the project's server privacy settings consistent with these attributes. A production website uses the public HTTPS host, not localhost.
import Script from "next/script";
// Inside your root layout's <body>:
<Script src="https://weeveo.com/weeveo.js"
strategy="afterInteractive"
data-project-id="YOUR_PROJECT_UUID"
data-host="https://weeveo.com"
data-mode="cookieless"
data-consent="banner"
data-privacy-url="https://example.com/privacy" />React, Vue, Svelte and plain HTML
Paste the standard snippet in the application's shared HTML shell. For Vite this is typically index.html. The tracker handles pushState, replaceState and popstate changes in pathname. Query-only changes do not create a new automatic pageview. Avoid installing the script in a component that mounts repeatedly.
WordPress and WooCommerce
Use your theme's shared head/footer integration or a trusted custom-code mechanism. Install once, keep it out of checkout/account private pages if appropriate, and configure your CMP. WooCommerce revenue is a separate payment integration; installing the tracker does not connect payment webhooks.
Shopify and other hosted builders
Use the builder's supported custom-code area for your storefront. Platform restrictions may prevent script execution in protected checkout pages. Verify the public storefront, and connect Shopify or your actual provider separately for revenue. Never paste a Weeveo API key into theme code.
Tag managers and CSP
If a tag manager controls loading, load once and coordinate consent rather than firing duplicate tags on every navigation. Permit the chosen tracking host in script-src and connect-src in your Content Security Policy; optional recording also loads recorder.js. Avoid weakening the policy with broad wildcards.
Client-side event readiness
The tracker loads asynchronously. Call its methods after it has loaded; optional chaining prevents a crash but drops an action that occurs before readiness. The current browser SDK does not provide a pre-load event queue.
Still looking for an answer? Try troubleshooting or get in touch.