Home
Credentials Generator
Generate credentials My generated credentials
QA Analytics
Analytics workspace Tracking integrations Analytics reports User Journey Explorer Conversion funnels Analytics debugger
More
Documentation Pricing Contact Us
LoginCreate free account
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

  1. Install the free WPCode plugin (Plugins › Add New).
  2. Go to Code Snippets › Header & Footer.
  3. 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

  1. Tags › New › Tag configuration › Custom HTML.
  2. Paste the installation code.
  3. 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.