Matomo Form Analytics trigger failing on dynamic single-page web portal

Hello Matomo Community,

We are integrating Matomo Analytics (on-premise build) to track user interaction events across dynamic multi-step form submissions on our web portal (hdclaims.co.uk).

Issue Description:

Standard pageview tracking via _paq.push(['trackPageView']) executes cleanly. However, when triggering custom Form Analytics events (_paq.push(['FormAnalytics::scanForForms'])) after dynamic DOM node updates, the analytics collector endpoint drops incoming tracking requests with an HTTP 400 Bad Request error.

Technical Setup:

  • Matomo Version: Matomo On-Premise 5-x

  • Tracking Method: JavaScript Tracker (matomo.js) + Tag Manager

  • Target Domain: (hdclaims.co.uk)

  • Browsers Affected: Google Chrome 125, Mozilla Firefox 126

Steps Taken:

  1. Configured custom dimensions to capture form field focus states.

  2. Verified that setCookieDomain and setDomains match the root domain configuration.

  3. Inspected browser network tab; payload parameters fail parsing when dynamic form steps push state via History API (pushState).

Is there a specific JavaScript tracker configuration or execution delay required when calling scanForForms on dynamic .co.uk web applications with single-page step routing?

Any technical insights from analytics engineers would be greatly appreciated!

Scott Aerators team: Dynamic single-page applications can definitely make form tracking more complicated, especially when elements load or change without a full page refresh. Checking when the form is actually rendered and how the tracking trigger detects those changes could help pinpoint the issue.

For a dynamic SPA, I would check the timing of scanForForms first. Make sure the form elements exist in the DOM before calling the scan, especially after pushState changes. Also inspect the generated tracking request for invalid or stale parameters. A MutationObserver or route-change trigger with a short delay after rendering might help isolate the issue.