Skip to content

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 loads
window.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>
OptionDefaultDescription
hostDetected from the requestThe 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
respectDoNotTracktrueHonor the browser’s Do Not Track setting
autoInstrumentButtonstrueAutomatically track button clicks
autoSendPageViewstrueAutomatically send page views
debugfalseEnable 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)
scrollSectionThreshold0.5Default visibility ratio for section tracking (0–1 or percentage)

Use this to track only page views:

window.Fusionaly = window.Fusionaly || {};
window.Fusionaly.config = {
autoInstrumentButtons: false,
autoSendPageViews: true,
respectDoNotTrack: true,
debug: false
};

Use this during development and testing:

window.Fusionaly = window.Fusionaly || {};
window.Fusionaly.config = {
debug: true
};