Enhanced Measurement

Automatically track scroll depth, outbound clicks, file downloads, site search, video engagement, and form interactions.

Overview#

Enhanced measurement automatically captures common user interactions without writing any custom tracking code. It is enabled by default when you add the tracker script, and JustAnalytics will automatically track scroll depth, outbound link clicks, file downloads, site search queries, video engagement, and form interactions.

Enhanced Measurement is Enabled by Default#

All enhanced measurement features are active automatically. No extra attributes are needed:

<!-- Enhanced measurement is ON by default -->
<script
  defer
  data-site-id="YOUR_SITE_ID"
  src="https://youranalytics.com/tracker.js"
></script>

To disable all enhanced measurement features, add data-enhanced-measurement="false":

<script
  defer
  data-site-id="YOUR_SITE_ID"
  data-enhanced-measurement="false"
  src="https://youranalytics.com/tracker.js"
></script>

To disable only specific features, use individual toggles (see Individual Toggles below).

Scroll Depth#

Tracks how far visitors scroll down each page.

What Gets Tracked#

Scroll events fire when the visitor scrolls past these thresholds:

| Threshold | Event Name | Description | |-----------|------------|-------------| | 25% | scroll_depth | Visitor saw the first quarter of the page | | 50% | scroll_depth | Visitor saw half the page | | 75% | scroll_depth | Visitor saw three quarters of the page | | 90% | scroll_depth | Visitor saw nearly the entire page | | 100% | scroll_depth | Visitor reached the bottom |

Event Properties#

{
  "eventType": "scroll_depth",
  "properties": {
    "depth_percentage": 75,
    "depth_pixels": 4500,
    "page_height": 6000,
    "url": "/blog/getting-started"
  }
}

Dashboard View#

Scroll depth data appears in:

  • Events page -- scroll_depth events with threshold breakdown
  • Pages detail -- per-page scroll depth distribution chart
  • Engagement report -- aggregate scroll depth across the site

Individual Toggle#

data-track-scroll="true"

Tracks when visitors click links that navigate away from your domain.

What Gets Tracked#

A click event fires whenever a visitor clicks an <a> tag whose href points to a different domain than the current page.

Event Properties#

{
  "eventType": "outbound_click",
  "properties": {
    "url": "https://github.com/your-repo",
    "link_text": "View on GitHub",
    "link_domain": "github.com",
    "source_page": "/integrations"
  }
}

Exclusions#

These links are not tracked as outbound:

  • Links to subdomains of your site (e.g., blog.example.com if your site is example.com)
  • mailto: and tel: links
  • javascript: links
  • Links with data-ja-ignore attribute

Individual Toggle#

data-track-outbound="true"

File Downloads#

Tracks when visitors click links to downloadable files.

Tracked File Extensions#

By default, clicks on links to files with these extensions are tracked:

pdf, doc, docx, xls, xlsx, ppt, pptx,
zip, rar, 7z, tar, gz,
exe, dmg, msi, pkg, deb, rpm,
csv, txt, rtf,
mp3, mp4, avi, mov, wmv, flv,
svg, png, jpg, jpeg, gif, webp

Event Properties#

{
  "eventType": "file_download",
  "properties": {
    "file_name": "whitepaper-2026.pdf",
    "file_extension": "pdf",
    "file_url": "/downloads/whitepaper-2026.pdf",
    "link_text": "Download Whitepaper",
    "source_page": "/resources"
  }
}

Custom Extensions#

Add additional file extensions to track:

data-download-extensions="sketch,fig,ai,eps"

This appends to the default list. The full set becomes the defaults plus your custom extensions.

Individual Toggle#

data-track-downloads="true"

Tracks when visitors use your site's search functionality.

How It Works#

JustAnalytics detects search queries by monitoring URL query parameters. When a pageview occurs with a recognized search parameter, a site_search event is automatically generated.

Default Search Parameters#

The following query parameters are recognized as search queries:

q, query, search, s, keyword, term, k

Event Properties#

{
  "eventType": "site_search",
  "properties": {
    "search_term": "pricing plans",
    "query_parameter": "q",
    "url": "/search?q=pricing+plans",
    "results_page": 1
  }
}

Custom Search Parameters#

If your site uses a non-standard search parameter, configure it:

data-search-params="q,search,find,lookup"

Dashboard View#

Site search data appears in:

  • Events page -- site_search events with search term breakdown
  • Engagement report -- top search terms, searches per session, search exit rate

Individual Toggle#

data-track-search="true"

Video Engagement#

Tracks how visitors interact with embedded videos (YouTube iframes and HTML5 <video> elements).

YouTube Videos#

JustAnalytics automatically detects YouTube iframe embeds and tracks:

| Event | Description | |-------|-------------| | video_start | Video playback started | | video_progress | Video reached 25%, 50%, 75% | | video_complete | Video reached 100% (or within 5 seconds of end) | | video_pause | Video was paused |

HTML5 Videos#

Native <video> elements are also tracked with the same events.

Event Properties#

{
  "eventType": "video_progress",
  "properties": {
    "video_provider": "youtube",
    "video_title": "Product Demo",
    "video_url": "https://youtube.com/watch?v=abc123",
    "video_duration": 180,
    "video_percent": 50,
    "video_current_time": 90,
    "source_page": "/demo"
  }
}

YouTube Requirements#

For YouTube tracking to work, your iframe embed must use the enablejsapi=1 parameter:

<iframe
  src="https://www.youtube.com/embed/VIDEO_ID?enablejsapi=1"
  allow="autoplay; encrypted-media"
  allowfullscreen
></iframe>

JustAnalytics automatically appends enablejsapi=1 if it is missing, but some Content Security Policies may prevent this.

Individual Toggle#

data-track-video="true"

Form Interactions#

Tracks how visitors interact with forms on your pages.

Tracked Events#

| Event | Description | When | |-------|-------------|------| | form_start | Visitor began filling out a form | First field focus | | form_submit | Form was submitted | Submit event fires | | form_abandon | Visitor left the page without submitting | Page unload with started but unsubmitted form |

Event Properties#

{
  "eventType": "form_submit",
  "properties": {
    "form_id": "contact-form",
    "form_name": "Contact Us",
    "form_destination": "/api/contact",
    "form_method": "POST",
    "fields_filled": 5,
    "time_to_complete": 45,
    "source_page": "/contact"
  }
}

Form Identification#

Forms are identified by (in priority order):

  1. id attribute
  2. name attribute
  3. action URL
  4. Position on page (e.g., "form-3")

Privacy#

Form field values are never captured. Only structural information (field count, form ID, completion time) is tracked. Input values, passwords, and personal data are never sent to JustAnalytics.

Individual Toggle#

data-track-forms="true"

Individual Toggles#

All enhanced measurement features are enabled by default. You can disable individual features by setting their toggle to "false":

<!-- Disable video and form tracking, keep everything else -->
<script
  defer
  data-site-id="YOUR_SITE_ID"
  data-track-video="false"
  data-track-forms="false"
  src="https://youranalytics.com/tracker.js"
></script>

Toggle Reference#

| Attribute | Feature | Default | |-----------|---------|---------| | data-enhanced-measurement | All features (master toggle) | true (enabled) | | data-track-scroll | Scroll depth tracking | Enabled | | data-track-outbound | Outbound link clicks | Enabled | | data-track-downloads | File downloads | Enabled | | data-track-search | Site search | Enabled | | data-track-video | Video engagement | Enabled | | data-track-forms | Form interactions | Enabled |

Disabling Specific Features#

Since enhanced measurement is on by default, disable specific features by setting them to false:

<script
  defer
  data-site-id="YOUR_SITE_ID"
  data-track-video="false"
  data-track-forms="false"
  src="https://youranalytics.com/tracker.js"
></script>

This keeps scroll, outbound, downloads, and search active -- but disables video and form tracking.

Performance Impact#

Enhanced measurement adds minimal overhead:

  • Script size: ~1.5KB additional (gzipped) on top of the base tracker
  • Event volume: typically 2-5 additional events per pageview
  • CPU: passive event listeners, no polling or mutation observers
  • Network: events are batched with regular tracker events (no extra requests)

The scroll depth observer uses IntersectionObserver where available, falling back to a throttled scroll listener (100ms) for older browsers.