> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Configuration Reference

> All Scanova Browser SDK init options explained — auto-tracking flags, debug mode, custom endpoint, and defaults.

The SDK is configured with a single `scanova('init', siteId, options)` call. This page documents every available option.

## Syntax

```javascript theme={null}
scanova('init', 'YOUR_SITE_ID', {
  // options here
});
```

## Options reference

| Option         | Type    | Default                   | Description                                                                           |
| -------------- | ------- | ------------------------- | ------------------------------------------------------------------------------------- |
| `autoPageview` | boolean | `false`                   | Automatically send a `pageview` event on every page load.                             |
| `autoClicks`   | boolean | `false`                   | Automatically track clicks on links, buttons, and `[role="button"]` elements.         |
| `autoForms`    | boolean | `false`                   | Automatically track form submissions.                                                 |
| `autoScroll`   | boolean | `false`                   | Track scroll depth at 25%, 50%, 75%, and 90% milestones.                              |
| `debug`        | boolean | `false`                   | Print SDK activity to the browser console. Useful during development.                 |
| `endpoint`     | string  | `https://t.scanova.io/ct` | Override the event collection endpoint. Only change if instructed by Scanova support. |

## Option details

### `autoPageview`

Fires a `pageview` event each time the SDK initialises on a page. This happens automatically on full page loads. For single-page apps, see the [SPA guide](/conversion-tracking/browser/spa-frameworks) for how to fire page view events on route changes.

```javascript theme={null}
scanova('init', 'YOUR_SITE_ID', { autoPageview: true });
```

Each `pageview` event includes `page_url`, `referrer`, `scan_session_id`, and device/visitor context. See [Auto-Tracked Events](/conversion-tracking/browser/auto-tracking#page-view) for the full payload.

### `autoClicks`

Listens for clicks on:

* `<a>` tags
* `<button>` tags
* Elements with `role="button"`

The captured click event includes `element_type`, `element_text`, and optionally `destination_url` for links.

Tip: Add `data-scnv-name="My Button"` to any element to override the captured label:

```html theme={null}
<button data-scnv-name="Pricing CTA">Start Trial</button>
```

### `autoForms`

Listens for the `submit` event on `<form>` elements. Captures `form_name` and `form_action`. The form's field values are **never captured** — only the form identifier.

Tip: Add `data-scnv-name="Contact Form"` to a form to give it a readable name in reports.

### `autoScroll`

Fires scroll depth events when the user scrolls past 25%, 50%, 75%, and 90% of the page height. Each milestone fires only once per page load and includes `scroll_depth` in the metadata.

### `debug`

Enables console logging. Use during development to confirm the SDK is initialising, capturing events, and sending them correctly.

```javascript theme={null}
scanova('init', 'YOUR_SITE_ID', { debug: true });
// Console output:
// [QCG SDK] Initialized with Site ID: YOUR_SITE_ID
// [QCG SDK] Loaded version 1.x.x
```

Disable `debug` in production — the option is `false` by default.

## Recommended production config

```javascript theme={null}
scanova('init', 'YOUR_SITE_ID', {
  autoPageview: true,
  autoClicks: true,
  autoForms: true,
  autoScroll: true,
  debug: false
});
```

## Minimal config (page views only)

```javascript theme={null}
scanova('init', 'YOUR_SITE_ID', {
  autoPageview: true
});
```

## Manual-only config (no auto-tracking)

Use this if you want full control over what gets tracked — every event will be sent explicitly via `scanova('track', ...)`.

```javascript theme={null}
scanova('init', 'YOUR_SITE_ID', {
  autoPageview: false,
  autoClicks: false,
  autoForms: false,
  autoScroll: false
});
```

## Important: one init per page load

Call `scanova('init', ...)` **once** per page lifecycle. Calling it multiple times will register duplicate auto-tracking listeners and result in doubled events.

For single-page apps, call `init` once when the app boots — not on every route change. Use the [SPA guide](/conversion-tracking/browser/spa-frameworks) for route-change tracking.

## Disabling tracking for specific users

The SDK has no built-in `disable()` method. To prevent tracking for specific users (logged-in staff, opted-out users, bots), conditionally skip loading the snippet entirely:

```html theme={null}
<script>
  // Example: skip tracking for your own team
  const isInternalUser = document.cookie.includes('internal_user=true');

  if (!isInternalUser) {
    (function(w,d,s,o,f,js,fjs){
      w['ScanovaTrackingObject']=o;w[o]=w[o]||function(){(w[o].q=w[o].q||[]).push(arguments)};
      js=d.createElement(s),fjs=d.getElementsByTagName(s)[0];
      js.id=o;js.src=f;js.async=1;fjs.parentNode.insertBefore(js,fjs);
    })(window,document,'script','scanova','https://cdn.scanova.io/ct/js/qcg.min.js');
    scanova('init', 'YOUR_SITE_ID', { autoPageview: true });
  }
</script>
```

The same pattern applies for GDPR consent — only load the SDK after the user grants tracking consent. See [Privacy and GDPR](/conversion-tracking/event-model#privacy-and-gdpr) for details.
