Add data-auto-pageview attribute to tracker script

Allow disabling the automatic initial pageview while keeping
performance tracking, click handling, and path change detection active.
This commit is contained in:
Manuel Fé Santos
2026-04-30 11:04:26 +01:00
parent ea52adea6b
commit 790354d3ac
+2 -1
View File
@@ -37,6 +37,7 @@
const domain = config('domains') || '';
const credentials = config('fetch-credentials') || 'omit';
const perf = config('performance') === _true;
const autoPageview = config('auto-pageview') !== _false;
const domains = domain.split(',').map(n => n.trim());
const host =
@@ -197,7 +198,7 @@
const init = () => {
if (!initialized) {
initialized = true;
track();
if (autoPageview) track();
handlePathChanges();
handleClicks();
if (perf) initPerformance();