On this page

Script attributes and client options

This page lists every setting you can put on the Noxtica script tag and every option you can pass to createClient() or init(), with the accepted values, the default and what each one changes. Use it when you edit the generated tag, wire the collector from your own code, or review a tag someone else pasted.

Key points

  1. Tag without a key is skippedA script tag without data-site-key creates no client and fires no events. A tag also needs data-auto-init, and its file name must contain noxtica-collector or /noxtica.js.
  2. Bad values never break collectionThe loader reads attributes once, when the tag initialises. A value it cannot parse is ignored and collection carries on.
  3. Seven-day default cache windowcheckOnce() uses the call option, then the client option, then the domain policy, then seven days. data-ttl-seconds sets the call value for the automatic check.
  4. Log level: tag winsThe data-log-level attribute beats the logLevel option, which beats the domain setting. Without any of them the loader is silent.
How this page is organisedBar length shows each section’s share of the text. Select a section to jump to it.

What it is

Availability: Evaluation access. Availability depends on your plan, role and the modules enabled for your organisation.

The browser collector has two entry points:

  • The script tag. The core script reads data-* attributes from its own tag when the page has loaded. Backoffice → Integrations & API → Script & Consent → Snippets generates the tag with your Site Key. Install and consent concepts stay on Install and Browser Runtime.
  • Client options. window.NoxticaCollector.createClient(options) takes the same ideas as an object, plus callbacks that an attribute cannot carry (onChallenge, onBlock). The typed @noxtica/sdk wrapper has an init(config) function that forwards a subset of these options. That wrapper is not installable from the public registry today; see SDK family and availability.

The loader reads the attributes once, when the tag initialises. Changing an attribute afterwards has no effect until the next page load. A value the loader cannot parse is ignored and never breaks collection.

Prerequisites

  • A domain with a Site Key. Backoffice → Domains lists the key; see Domains, site keys and the install card.
  • A page served from the origin registered for that Site Key. A token request from another origin is refused with 403 and {"error":"Origin mismatch"}.
  • Workspace admin access to Backoffice → Integrations & API → Script & Consent, if you want to copy the generated tag instead of typing it.
  • The core script URL on your collector host: https://collect.noxtica.com/collector/noxtica-collector-core.js. The extensions script takes no attributes and no Site Key; it attaches to the core on the page.

Steps

1. Start from the generated tag

Open Backoffice → Integrations & API → Script & Consent, pick the domain, and copy the core snippet from the Snippets tab. Two switches on that tab add attributes for you: Add data-extensions=“auto” to the core snippet and Add data-consent-mode=“api” to the core snippet.

<script
	src="https://collect.noxtica.com/collector/noxtica-collector-core.js"
	data-site-key="pk_prod_your_site_key_here"
	data-auto-init
	data-auto-check-once
	async
></script>

Keep the file name. The loader binds a tag when its src contains noxtica-collector or /noxtica.js and the tag carries data-auto-init; a tag that misses either condition is ignored. This matters when you copy the script to your own path or serve it through a first-party relay.

2. Set the attributes you need

AttributeAccepted valuesDefaultEffect
data-site-keyYour Site Keynone, requiredA tag without it is skipped: no client, no events. The key works on the origin registered for its domain.
data-auto-initBoolean attributeoffCreates the client for this tag, assigns window.noxticaClient, runs the window.noxtica command queue, then dispatches noxtica:ready. Without it the loader does nothing by itself.
data-auto-check-onceBoolean attributeoffAfter noxtica:ready, runs checkOnce() once per page load and announces the result with noxtica:collected. Recommended.
data-auto-collectBoolean attributeoffLegacy. Runs collectAndSubmit() on every page load, without the cache. Ignored when data-auto-check-once is also present.
data-ttl-secondsPositive integernoneCache window in seconds for the automatic check. Read together with data-auto-check-once; without that attribute it has no effect. Zero, negative and non-numeric values are ignored.
data-check-interval-daysPositive numbernoneCache window in days for every checkOnce() call of this client. Zero, negative and non-numeric values are ignored.
data-api-urlhttps URL, or any URL on localhost or 127.0.0.1https://collect.noxtica.comCollector origin for the token, submit and visit calls. Any other value is ignored and a warning is logged.
data-ingest-urlauto, or an https URL (or a localhost URL)autoOrigin for high-volume telemetry: RUM, RUM error detail, console logs, the client buffer, and the replay policy and upload calls. The interaction tracker stays on the collector. auto derives https://ingest.noxtica.com from the default collector host and keeps any other data-api-url host for telemetry too. An explicit URL wins; set it to the collector origin to keep telemetry on the collector. An invalid value is ignored and a warning is logged.
data-consent-modeapi, cookie:<name>, cookie:<name>=<value>, gcm, not_requirednoneDeclares the consent mode before the signed token arrives. A declaration can make the client stricter; it never relaxes the mode saved for the domain. See Consent modes.
data-consent-cookie<name> or <name>=<value>noneShorthand for data-consent-mode="cookie:<name>". Ignored when data-consent-mode is present and valid.
data-extensionsautomanualauto makes the core load the extensions script itself. Any other value keeps the extensions manual, and overrides the automatic default of the legacy script URLs. The domain setting Load the extensions script automatically once consent is granted (immediately in Not required mode) still applies.
data-log-levelsilent, error, warn, info, debugsee step 5Highest-precedence console log level. An invalid value is ignored.
data-debugBoolean attributeoffLegacy switch. Behaves like log level debug when no explicit level is set anywhere.
data-debug-uploadBoolean attributeoffDiagnostic. Replay chunk and finalize uploads are captured on the page instead of being sent. Do not leave it on in production.
integrity, crossorigin="anonymous"SRI hash, as generatednoneThe pinned variant of the tag. See Stable or pinned snippets.
asyncBoolean attributenoneLets the page render while the core loads.

Two attributes go on your own forms, not on the script tag:

AttributeWhereDefaultEffect
data-nox-protect="<action>"A form, or a button or input inside onenoneRuns the protected-action check for the named action. The action must be declared for the domain. See Protected actions.
data-nox-protect-timeout="<ms>"The same form6000How long a native form submit is held while the check runs. A value that is not a positive integer falls back to the default.

3. Choose how often the page check runs

checkOnce() returns the cached result while the cache window is open and records a visit instead of collecting again. The loader picks the window in this order, and the earliest match wins:

  1. ttlSeconds in the call. For the automatic check this is data-ttl-seconds.
  2. checkIntervalDays in the call.
  3. The client option checkIntervalDays, which data-check-interval-days sets.
  4. The checkIntervalDays value in the domain policy delivered with the session token.
  5. Seven days.

Call options for checkOnce(options):

OptionDefaultEffect
ttlSecondsnoneCache window in seconds for this call.
checkIntervalDaysnoneCache window in days for this call.
forceRefreshfalseClears the stored state and collects again.
recordVisittrueRecords a visit on a cache hit. With false the cached result comes back with visitRecorded: false.
metanoneMetadata passed with the visit record.

4. Create a client from code

Use createClient when a tag with data-auto-init does not fit, for example when your page decides at run time whether to start Noxtica. A client you create yourself does not set window.noxticaClient, does not dispatch noxtica:ready and does not read the command queue. Its results come back through the promises it returns.

<script>
	const tag = document.createElement('script');
	tag.src = 'https://collect.noxtica.com/collector/noxtica-collector-core.js';
	tag.async = true;
	tag.onload = () => {
		const client = window.NoxticaCollector.createClient({
			siteKey: 'pk_prod_your_site_key_here',
			consentMode: 'api',
			logLevel: 'silent',
		});
		client.checkOnce().then((result) => console.log(result.success));
	};
	document.head.appendChild(tag);
</script>

createClient throws NoxticaCollector: siteKey is required when it finds no Site Key, either in the siteKey option or on a collector tag with data-site-key.

OptionType and defaultEffect
siteKeystringYour Site Key. Falls back to the data-site-key of a collector tag on the page.
apiUrlhttps URL, default https://collect.noxtica.comCollector origin.
ingestUrlURL or 'auto', default 'auto'Telemetry origin; same rules as data-ingest-url.
mode'max' (default) or 'lite'max collects the full signal set. lite skips the collectors that belong to max mode. Protected actions always run in minimal mode.
checkIntervalDaysnumberClient-level cache window.
signatureMode'require' (default), 'warn', 'disabled'What the client does when a signed server response is missing or altered. require rejects it, warn logs and continues, disabled skips the check. An unknown value falls back to require. Keep require.
accountIdstring, up to 256 charactersYour own end-user account id, sent with the next submit. Use an opaque id, not an e-mail address. client.setAccountId(id) sets it later.
consentMode'api', 'cookie:<name>', 'cookie:<name>=<value>', 'gcm', 'not_required'Same as data-consent-mode.
extensions'auto'Same as data-extensions="auto".
logLevel'silent', 'error', 'warn', 'info', 'debug'Same as data-log-level, one precedence step lower.
debugbooleanLegacy form of log level debug.
debugUploadsbooleanSame as data-debug-upload.
onChallengefunctionCalled with { status, method } while the server asks for a step-up challenge. Advisory.
onBlockfunctionCalled with { status, mode } when the page enforces a server block. Advisory.
release, buildId, subjectHandlestringsLabels for browser error detail. They take effect when the extensions are loaded. See Browser errors, console logs and source maps.

The wrapper’s init(config) accepts siteKey, apiUrl, ingestUrl, mode, checkIntervalDays, signatureMode, accountId, debug, logLevel, onChallenge, onBlock, release, buildId, subjectHandle and observability, plus options that are specific to the wrapper:

Wrapper optionDefaultEffect
script'core''core' injects the core script. 'combined' injects the legacy combined script.
extensions'manual''manual' waits for loadExtensions(). 'auto' lets the core load them. 'never' makes loadExtensions() reject, and cannot be combined with script: 'combined'.
scriptUrl, pinnedLoadernoneInject a pinned core: set scriptUrl to the hashed file name from the collector manifest and pinnedLoader.integrity to its hash. The URL must be https on the default collector origin or your own apiUrl origin.

init() does not pass consentMode to the loader. To declare a mode, put data-consent-mode on the tag or call createClient directly.

5. Set the log level

The loader writes nothing to the console by default. Four sources can change that. The highest one that holds a valid value wins:

  1. The data-log-level attribute on the script tag.
  2. The logLevel option of createClient() or init(), or NoxticaCollector.setLogLevel(level).
  3. The domain setting. In Backoffice open Domains, open the domain, then Configuration → Client log level → Console log level. The choices are SDK default, Silent, Error, Warn, Info and Debug. The value arrives with each session token, so a change applies from the next token.
  4. The SDK default: silent, unless data-debug, the debug option or window.NOXTICA_DEBUG = true turns on debug.

silent means no console output from any Noxtica code path. Read the effective level with window.NoxticaCollector.getLogLevel().

A data-log-level attribute applies before the loader reads the other attributes, so it also reveals the warnings from step 2, such as a rejected data-api-url. The domain setting arrives later, with the token.

  1. Start from the generated tag

    Copy the core snippet from Script & Consent → Snippets. Keep the file name and the data-auto-init attribute.

  2. Set the attributes you need

    Use the attribute table for check mode, endpoints, consent and extensions, diagnostics and protected forms.

  3. Choose how often the check runs

    Pick a cache window with data-ttl-seconds, data-check-interval-days or checkOnce options. Seven days applies when nothing else is set.

  4. Create a client from code

    Call createClient with siteKey and the options you need. A client made this way sets no window.noxticaClient and reads no command queue.

  5. Set the log level

    Use data-log-level, the logLevel option or the domain setting in Configuration → Client log level. Check the result with getLogLevel().

From generated tag to verified settings

Verify it works

Run these in the browser console on a page that carries the tag:

typeof window.noxticaClient;            // 'object' when data-auto-init bound the tag
window.noxticaClient.siteKey;           // your Site Key
window.noxticaClient.apiUrl;            // the collector origin in use
window.noxticaClient.ingestUrl;         // the telemetry origin in use
window.NoxticaCollector.VERSION;        // the loader version, for example '3.8.1'
window.noxtica.v;                       // the same version, published for the duplicate-tag guard
window.NoxticaCollector.getLogLevel();  // the effective log level

In DevTools → Network you see POST /client/token on the collector host with status 200. After consent, when the extensions run, and with data-ingest-url left at auto on the default collector, telemetry requests go to ingest.noxtica.com.

Troubleshooting

SymptomCauseFix
window.noxticaClient is undefined and no noxtica:* event firesThe tag lacks data-auto-init or data-site-key, or the src file name contains neither noxtica-collector nor /noxtica.jsAdd the attributes, or keep the original file name when you copy or proxy the script.
data-api-url has no effectThe value is not https and not on localhost or 127.0.0.1, or it is not a valid URLUse an https URL. The warning appears at log level warn or higher.
Telemetry still goes to the collector hostdata-ingest-url equals the collector origin, or data-api-url points at a host other than the default collectorSet data-ingest-url to the telemetry origin you want.
Changing an attribute in the console changes nothingThe loader read the attributes when the tag initialisedReload the page, or create a client from code.
getConsent().mode differs from data-consent-modeThe mode saved for the domain wins once the token arrivesSee Consent modes.
NX001: already loaded in the consoleA second core or combined tag is on the page, for example one pasted by hand and one from a tag managerRemove the extra tag. The initial one keeps running.
NoxticaCollector: siteKey is requiredcreateClient found no Site KeyPass siteKey, or keep data-site-key on a collector tag.
403 with Origin mismatch on /client/tokenThe page origin is not the origin registered for the Site KeyUse the key of the exact origin the page runs on.