SDK Configuration
Configure the Fusionaly JavaScript SDK
Use these options to change how the Fusionaly JavaScript SDK tracks events. Set the options before the SDK script loads:
<script>// Modify configuration before the SDK loadswindow.Fusionaly = window.Fusionaly || {};window.Fusionaly.config = { respectDoNotTrack: true, // Honor browser's Do Not Track setting autoInstrumentButtons: true, // Auto-track button clicks autoSendPageViews: true, // Automatically send page views debug: false // Enable debug logging // scrollDepthThresholds: [25, 50, 75, 100], // Optional defaults for scroll depth milestones // scrollDepthEventKey: "scroll:depth", // Optional base event key (final events look like scroll:depth:75) // scrollSectionEventKey: "scroll:section", // Optional base event key (final events look like scroll:section:pricing) // scrollSectionThreshold: 0.5 // Optional default intersection ratio for sections};</script><script defer src="https://your-domain.com/y/api/v1/sdk.js"></script>Configuration Options
Section titled “Configuration Options”| Option | Default | Description |
|---|---|---|
host |
Detected from the request | The URL the SDK sends events to. Set this if your reverse proxy does not forward X-Forwarded-Host/X-Forwarded-Proto. See Put a Reverse Proxy in Front |
respectDoNotTrack |
true |
Honor the browser’s Do Not Track setting |
autoInstrumentButtons |
true |
Automatically track button clicks |
autoSendPageViews |
true |
Automatically send page views |
debug |
false |
Enable debug logging to console |
scrollDepthThresholds |
[25, 50, 75, 100] |
Default depth milestones when the page does not provide its own thresholds |
scrollDepthEventKey |
"scroll:depth" |
Base event key used by scroll depth tracking (final events look like scroll:depth:75) |
scrollSectionEventKey |
"scroll:section" |
Base event key used by scroll section tracking (final events look like scroll:section:pricing) |
scrollSectionThreshold |
0.5 |
Default visibility ratio for section tracking (0–1 or percentage) |
Examples
Section titled “Examples”Minimal Configuration
Section titled “Minimal Configuration”Use this to track only page views:
window.Fusionaly = window.Fusionaly || {};window.Fusionaly.config = { autoInstrumentButtons: false, autoSendPageViews: true, respectDoNotTrack: true, debug: false};Debug Mode
Section titled “Debug Mode”Use this during development and testing:
window.Fusionaly = window.Fusionaly || {};window.Fusionaly.config = { debug: true};Exclude Your Own Visits
Section titled “Exclude Your Own Visits”To stop counting your own visits, open your site, open the browser console, and run:
localStorage.setItem("fusionaly_ignore", "true");The SDK then sends nothing from this browser on this site. To count the browser again, run localStorage.removeItem("fusionaly_ignore"). This needs Fusionaly 2.12 or later.