TrackingThe script tag

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>
AttributeEffect
data-siteRequired. The site’s hostname as registered in Lynq. www. and case are ignored.
data-vitalsReport Core Web Vitals (LCP, CLS, INP, FCP, TTFB) plus load timings for the Performance screen. Loads a second 4.5 kB chunk after the page is interactive.
data-outboundRecord 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-eventsRecord 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-errorsReport uncaught JavaScript errors and unhandled promise rejections to the Errors 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-allow-localhostCount visits on localhost and 127.0.0.1, which are ignored otherwise.
data-respect-dntSend 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, at most twenty per request, 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.

Versioning

/js/lynq.js is always the current tracker and is cached for five minutes. There is nothing to upgrade on your side.