The tracking script is where most web analytics begins. It is usually one line of HTML, a <script> tag pointing at a file hosted by the analytics provider. Once loaded, it watches what happens on the page and reports it.
What a tracking script does
- Loads from the provider's address, or from your own domain through a proxy.
- Reads the context: the page address, the referrer, screen size, language and time zone.
- Identifies the browser for counting, usually with a random id in a first-party cookie, or with nothing stored at all in cookieless setups.
- Sends events: a page view on load, and goals, outbound clicks or scroll depth as they happen.
- Exposes an API so your own code can record actions, such as a sign-up.
The Reveata script
You paste one snippet inside the <head> of every page:
<script defer data-website-id="ws_your_tracking_id" src="https://reveata.com/js/script.js"></script>Your dashboard shows the snippet with your own tracking id. It loads with defer, so it never blocks your page, and it never throws errors into your site. Single-page apps are handled automatically: a page view is recorded on every history.pushState, replaceState and back or forward navigation (Install the script).
Without any setup it also records how far people scroll, how long each page stays visible and clicks on links to other sites. Options are set with data- attributes, for example data-cookieless="true" to store nothing in the browser, or data-exclude-paths="/admin/*" to skip private pages.
For each event it sends the page URL, the referrer, the screen and window size, the browser language and the time zone, plus any goal name and properties you add. The server works out the rest and never stores IP addresses (Privacy, cookies and cookieless mode).
Broken links, file downloads, form submissions and Core Web Vitals are opt-in, in a second script, script.extras.js, so the main one stays small.
The script adds window.reveata, with commands such as reveata('goal', 'signup') and reveata('identify', …). The full list is in the JavaScript API.
Things that stop a script working
- The snippet is missing from some pages, often templates that were not updated.
- A Content Security Policy does not list the script's address; see Content Security Policy.
- An ad blocker cancels the request; see ad blocker.
- A consent tool holds it back until people accept.
- Development hosts. Reveata ignores
localhostby default so test visits stay out of your numbers.
Adding data-debug="true" makes the Reveata script log what it does, and why it is off, in the browser console.
Performance
A script that loads with defer or async does not hold up the first paint of the page. Size still matters on slow phones, which is why optional features belong in separate files. Avoid loading two analytics scripts that do the same job.