Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Make sure undefined callbackResult (ignored event) is visible in logs (#5802)

Artur Pata3eeab0027337
diff --git a/tracker/installation_support/verifier-v2.js b/tracker/installation_support/verifier-v2.js
index e1cd01aa7f..2225d434e9 100644
--- a/tracker/installation_support/verifier-v2.js
+++ b/tracker/installation_support/verifier-v2.js
@@ -67,7 +67,8 @@ async function verifyPlausibleInstallation(options) {
plausibleVersion,
plausibleVariant,
testEvent: {
- ...testEvent,
+ ...testEvent, // callbackResult
+ testPlausibleFunctionError,
requestUrl: interceptedTestEvent?.request?.url,
normalizedBody: interceptedTestEvent?.request?.normalizedBody,
responseStatus: interceptedTestEvent?.response?.status,
@@ -243,7 +244,9 @@ async function testPlausibleFunction({ timeoutMs, debug }) {
window.plausible('verification-agent-test', {
callback: (testEventCallbackResult) => {
resolve({
- testEvent: { callbackResult: testEventCallbackResult }
+ testEvent: {
+ callbackResult: testEventCallbackResult ?? 'undefined or null'
+ }
})
}
})
diff --git a/tracker/test/installation_support/verifier-v2.spec.ts b/tracker/test/installation_support/verifier-v2.spec.ts
index a5812adf7e..2895dbf9a5 100644
--- a/tracker/test/installation_support/verifier-v2.spec.ts
+++ b/tracker/test/installation_support/verifier-v2.spec.ts
@@ -70,7 +70,8 @@ test.describe('installed plausible web variant', () => {
version
},
responseStatus: 202,
- error: undefined
+ error: undefined,
+ testPlausibleFunctionError: undefined
},
cookiesConsentResult: incompleteCookiesConsentResult
}
@@ -132,7 +133,8 @@ test.describe('installed plausible web variant', () => {
version
},
responseStatus: undefined,
- error: undefined
+ error: undefined,
+ testPlausibleFunctionError: 'Test Plausible function timeout exceeded'
},
cookiesConsentResult: incompleteCookiesConsentResult
}
@@ -190,7 +192,8 @@ test.describe('installed plausible web variant', () => {
version
},
responseStatus: 400,
- error: undefined
+ error: undefined,
+ testPlausibleFunctionError: undefined
},
cookiesConsentResult: incompleteCookiesConsentResult
}
@@ -229,11 +232,12 @@ test.describe('installed plausible web variant', () => {
plausibleVersion: version,
plausibleVariant: 'web',
testEvent: {
- callbackResult: undefined,
+ callbackResult: 'undefined or null',
requestUrl: undefined,
normalizedBody: undefined,
responseStatus: undefined,
- error: undefined
+ error: undefined,
+ testPlausibleFunctionError: undefined
},
cookiesConsentResult: incompleteCookiesConsentResult
}
@@ -441,7 +445,8 @@ test.describe('installed plausible web variant', () => {
error: undefined,
normalizedBody: undefined,
requestUrl: undefined,
- responseStatus: undefined
+ responseStatus: undefined,
+ testPlausibleFunctionError: 'Test Plausible function timeout exceeded'
},
cookiesConsentResult: incompleteCookiesConsentResult
}
@@ -503,7 +508,8 @@ test.describe('installed plausible web variant', () => {
error: undefined,
normalizedBody: undefined,
requestUrl: undefined,
- responseStatus: undefined
+ responseStatus: undefined,
+ testPlausibleFunctionError: 'Test Plausible function timeout exceeded'
},
cookiesConsentResult: incompleteCookiesConsentResult
}