Skip to main content

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.

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

Syntax

scanova('init', 'YOUR_SITE_ID', {
  // options here
});

Options reference

OptionTypeDefaultDescription
autoPageviewbooleanfalseAutomatically send a pageview event on every page load.
autoClicksbooleanfalseAutomatically track clicks on links, buttons, and [role="button"] elements.
autoFormsbooleanfalseAutomatically track form submissions.
autoScrollbooleanfalseTrack scroll depth at 25%, 50%, 75%, and 90% milestones.
debugbooleanfalsePrint SDK activity to the browser console. Useful during development.
endpointstringhttps://t.scanova.io/ctOverride 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 for how to fire page view events on route changes.
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 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:
<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.
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.
scanova('init', 'YOUR_SITE_ID', {
  autoPageview: true,
  autoClicks: true,
  autoForms: true,
  autoScroll: true,
  debug: false
});

Minimal config (page views only)

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', ...).
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 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:
<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 for details.