The script tag
The tag is the whole configuration. There is no config file, no build step and no fetch for settings; each behaviour is an attribute.
<script defer src="https://lynq.byharsh.com/js/lynq.js" data-site="your-site.com" data-vitals></script>| Attribute | Effect |
|---|---|
data-site | Required. The site’s hostname as registered in Lynq. www. and case are ignored. |
data-vitals | Report Core Web Vitals (LCP, CLS, INP, FCP, TTFB) plus load timings for the Health screen. Loads a second 4.5 kB chunk after the page is interactive. |
data-outbound | Record clicks on links to other sites as an outbound event, and on file links (PDF, archives, installers, spreadsheets, documents, audio, video) as a download event, each with the url property. |
data-auto-events | Record a click on any element with data-lynq-event="name" as that event, with data-lynq-prop-* attributes as its properties. See custom events. |
data-errors | Report uncaught JavaScript errors and unhandled promise rejections to the Health screen: the message, the script and line, and the first 4 KB of the stack. Never the page’s data. Ten per page load at most. Loads a small third chunk. See Health. |
data-a11y | Measure accessibility on real visits for the Accessibility screen: whether the visit was navigated by keyboard, the estimated browser zoom, the reduced-motion and forced-colors preferences, and what got in the way — focus that could not leave, clickable elements with no keyboard route, sideways scrolling, motion, small targets. Aggregates only, over at least 20 sessions. Never typed text, form values or selectors; never detects assistive technology. Loads a small extra chunk. Collecting it is processing you must account for: see Accessibility. |
data-allow-localhost | Count visits on localhost and 127.0.0.1, which are ignored otherwise. |
data-respect-dnt | Send nothing at all from browsers with Do Not Track on. Off by default; see opt-out, GPC and DNT. |
Boolean attributes are present or absent; their value is not read.
What the script sends
A pageview carries the page’s path and title, the allow-listed query parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content, ref), the referrer, the screen and viewport size, and the language. Engagement is reported when the page is hidden or left: the milliseconds the tab was visible and focused, and the deepest scroll. Events are batched and sent about a second after they occur, and flushed when the page is left.
Nothing else is read from the browser. The country, region and city come from the request’s IP address on the server, which is then dropped. Page titles are kept only if the site’s settings say so.
With data-a11y, the script also reads the two preferences the browser reports (prefers-reduced-motion, forced-colors), the window and viewport widths for the zoom estimate, which elements keyboard focus lands on, which clickable elements are clicked, the page’s width and its running animations. What it sends for an element is its tag, role and the site’s own label for it, cut at 80 characters; for anything that is not a control, a short hash of its text instead. Never a field’s value, never a selector, never typed text. What it never reads.
Versioning
/js/lynq.js is always the current tracker and is cached for five minutes. There is nothing to upgrade on your side.