SDK Configuration
Configure the Fusionaly JavaScript SDK
Configure the Fusionaly JavaScript SDK to customize tracking behavior. Set configuration 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 |
|---|---|---|
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”For basic page view tracking only:
window.Fusionaly = window.Fusionaly || {};window.Fusionaly.config = { autoInstrumentButtons: false, autoSendPageViews: true, respectDoNotTrack: true, debug: false};Debug Mode
Section titled “Debug Mode”For development and testing:
window.Fusionaly = window.Fusionaly || {};window.Fusionaly.config = { debug: true};