Skip to content

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 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
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)

For basic page view tracking only:

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

For development and testing:

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