Skip to content
New storyWe built Skald to count visitors. It caught an AI-key thief.
SkaldEvery visit, truly told.

Docs · set-up · skald.js

The analytics script tag: what happens inside a page

Skald's analytics script tag is one line in your pages' head. It reports what your server log cannot see: forms started and sent, clicks, scroll and bookings. Your log figures never depend on it.

Analytics script tag here means skald.js: under 6.5 KB of plain JavaScript that sends in-page events to your own Skald, with no third-party code. It needs no cookie to count. It sets the first-party skald_vid cookie only when you share a visitor ID across subdomains.

30-day free trial · no card · we set it up within one working day · free to self-host

events from skald.js · sample/pricing/
  1. 09:14:02 page view /pricing/people
  2. 09:14:20 form started: contactform
  3. 09:14:41 phone click (never the number)click
  4. 09:15:03 read ¾ of the pagereading
  5. 09:15:30 Calendly bookedbooking

<script src="https://<your Skald>/traffic-js/skald.js" data-site="example.com" defer></script>

Sample events, and the tag as a template: copy yours from Settings > Integrations, where the address is your own.

[01] what it tracks

Events the script tag tracks by itself

Once the tag is on a page, it reports these with no extra code. A form records only its own id or name, never what a person typed. The log still counts the visits and pages: server log analytics.

pick a kind

Forms started, and forms sent

Form started fires when a field is first used, once per form per page. Form sent fires on submit. Mark a form data-skald="signup", "contact" or "waitlist" to name it. data-skald="off" leaves a form out, and search forms are always left out.

<form id="contact" data-skald="contact"> → Form started · Contact sent

[02] options

Script tag options: consent, subdomains and your other domains

Four boxes to tick in Settings > Integrations. The tag updates as you tick, so you copy it once.

Anonymous visitor IDs, which join a browser's visits to its lead, are off by default. The server admin turns them on per site. Off, the tag makes no ID and stores nothing in the browser. Turn them on only when your privacy notice says so.

Tick box · adds to the tag · what it does
Tick boxAddsWhat it does
Wait for consentdata-consent="required"Nothing sent, no ID kept, until your banner calls skald('consent', true)
Share across subdomainsdata-share-subdomains="true"www. and app. share one anonymous ID, in the first-party cookie skald_vid
Other domains you owndata-link-domains="…"Links to those domains carry the anonymous ID
Accept the ID from your other domainsdata-accept-id="true"This site takes the ID such a link brought

Do Not Track and Global Privacy Control win over every option: the tag then does nothing at all.

[03] privacy

What the script tag never collects

The tag sends events to your own Skald and nowhere else. It holds no name and no email. What it does not need, it never reads.

No typed text

No form field's value, ever. A form is known by its id or name.

No numbers or addresses

A phone or email click is counted, never the number or the email.

No stored IP address

The address is used in memory for the country and to limit abuse, then dropped.

No third parties

No third-party code, no fingerprinting, nothing sent anywhere but your Skald.

[04] install and test

Add the analytics script tag, then let the Test check your page

Nothing changes on your web server. The page loads the tag from your Skald and sends its events there. The Test then looks at your page and says what is wrong, in plain words.

  1. Copy it

    From Settings > Integrations, with the site chosen. Always copy yours: the address and site name are your own.

  2. Paste it once

    In the head every page shares: Next.js app/layout.tsx, WordPress header.php, a builder's head code, or Tag Manager on All Pages.

  3. Publish

    On a page twice, say in Tag Manager and in the HTML, the tag runs once. A page view is never sent twice.

  4. Test

    Settings > Connections, Only the script tag, Test connection. It says if a page opened with the tag.

What the Test finds on your page

While no event has arrived, Skald fetches your home page and reads it. It names the cause instead of waiting for ever.

Serve it from your own domain (optional)

Some ad blockers stop scripts from another address. Your web server can pass /traffic-js/ and /traffic-beacon on to Skald; the tag then loads from your own site. Skald must also trust that server for each visitor's address.

<script src="/traffic-js/skald.js" data-site="example.com" defer></script>

tag Test · what it can say · samplehome page
  1. The tag is not on your home page.add it
  2. The page loads Google Tag Manager: publish the container.publish
  3. The tag posts to www.example.com/traffic-beacon, which answers 308.copy the tag again
  4. Content-Security-Policy does not let it send to your Skald.connect-src
  5. Your page is at a host that is not one of the site's host names.Settings > Sites
  6. Connected: a page opened with the tag at 10:42.it works

[05] without a log

The script tag alone: what you lose without a server log

The tag runs only in a browser that runs JavaScript. Every machine that does not is invisible to it. That is why Skald reads the log first, and the tag is the add-on.

No card. We set up hosted Skald within one working day, or self-host it free.

What it does not do

  • It never sees AI crawlers, AI fetchers, search crawlers or bots. On Shopify, Webflow, Squarespace or with the tag alone, those are not seen at all.
  • With the tag alone, the five groups, the audit against the log and the bounds against page views do not apply. Its page openings show under Events.
  • People who block scripts are not counted by it. Citations from AI answers show only when the browser keeps the referrer.
  • Demo opened and Demo booked on your own booking step need one line from your site's code. Until it sends them, they read Not set up, never 0.

questions

Analytics script tag FAQ

Straight answers, including what Skald does not do.

Does Skald's script tag use cookies?

Not to count. The tag sets one first-party cookie, skald_vid, only when anonymous visitor IDs are on for the site and the ID is shared across subdomains. Visitor IDs are off by default. Dashboard sign-in uses its own session cookie.

Does the script tag see AI crawlers and bots?

No. AI crawlers, AI fetchers, search crawlers and most bots never run JavaScript, so no script tag sees them. Only a server or CDN log does. Use the tag beside the log for what happens inside a page.

Does it work with Google Tag Manager?

Yes. Publish the Tag Manager container with the tag firing on All Pages. If the tag ends up on a page twice, for example in Tag Manager and in the HTML, it runs once, so a page view is never sent twice.

How does it handle consent banners, Do Not Track and Global Privacy Control?

With Wait for consent ticked, the tag sends nothing and keeps no ID until your banner calls skald('consent', true). When a browser sends Do Not Track or Global Privacy Control, the tag does nothing at all: no ID, no storage, no event.

Can ad blockers stop the tag?

Some stop scripts that load from another address. You can serve the tag from your own domain: your web server passes /traffic-js/ and /traffic-beacon on to Skald. The set-up dialog has the nginx, Apache and Caddy lines under Advanced.

Is the script tag enough on its own?

Only when your site has no log at all, such as Shopify, Webflow or Squarespace. Then Skald counts people's page views and events only: no AI crawlers, no bots, no audit against the log. Server log analytics sees the rest.

$ tail -f access.log | skald

See what AI does with your site. Free for 30 days.

No card. We set up hosted Skald for you within one working day, or you self-host it free. Every line of your log, sorted and added up.

Start free trial Live demo