DataLook Docs
Install guides

Qwik City

Install DataLook on Qwik City — the plain script tag, or the first-party proxy that beats ad blockers. Both on one page.

Register the script in your root head export.

Add the script in root.tsx

Render the tag inside the <head> of your RootLayout.

src/root.tsx
<script defer src="https://cdn.datalook.app/s.js" data-site="YOUR_SITE_ID"></script>

The proxy install serves both s.js and the collector from your own domain, so ad blockers — which match on domain, not path — can't see us. You rewrite one innocuous path prefix to our CDN; the script figures out the rest.

A catch-all route handler forwards the prefix.

Add a proxy route

src/routes/_axis/[...path]/index.ts
import type { RequestHandler } from '@builder.io/qwik-city'const TARGET = 'https://cdn.datalook.app'const handler: RequestHandler = async ({ params, request, send, url }) => {  const res = await fetch(`${TARGET}/${params.path}${url.search}`, {    method: request.method,    headers: request.headers,    body: request.method === 'GET' ? undefined : await request.arrayBuffer(),  })  send(res)}export const onGet = handlerexport const onPost = handler

Point the script at the prefix

<script defer src="/_axis/s.js" data-site="YOUR_SITE_ID"></script>

Heads up

Your server now sits between the visitor and us, so forward the visitor IP (X-Forwarded-For) or your country breakdown will collapse to your server location. The DNS proxy avoids this entirely — see the proxy overview.