Docs › QA Analytics
How to install the tracking script
Paste this code just before the closing </head> tag of every page, replacing the ID with your site ID from Tracking Integrations:
<script
src="https://qarandom.com/tracker.js"
data-site-id="YOUR_UNIQUE_SITE_ID"
async>
</script>HTML websites
Add the code to the <head> of each page or your shared header include, then upload the files.
WordPress
- Install the free WPCode plugin (Plugins › Add New).
- Go to Code Snippets › Header & Footer.
- Paste the code into Header and save.
React
Create React App / Vite: add the tag to public/index.html or index.html. Next.js (App Router):
import Script from 'next/script';
export default function RootLayout({ children }) {
return (<html><body>{children}
<Script src="https://qarandom.com/tracker.js" data-site-id="YOUR_UNIQUE_SITE_ID" strategy="afterInteractive" />
</body></html>);
}Angular
Paste the code inside <head> in src/index.html. Router navigation is tracked automatically.
Other JavaScript sites (Vue, Svelte, Nuxt…)
var s = document.createElement('script');
s.src = 'https://qarandom.com/tracker.js';
s.async = true;
s.setAttribute('data-site-id', 'YOUR_UNIQUE_SITE_ID');
document.head.appendChild(s);Google Tag Manager
- Tags › New › Tag configuration › Custom HTML.
- Paste the installation code.
- Triggering: All Pages. Save, Submit and Publish.
Self-hosting the file
Click Download JavaScript file in Tracking Integrations to get a copy pre-configured with your site ID and the QA Random endpoint. The hosted version is recommended so you receive updates automatically.