Detect redirects in Matomo JS Tracker #13669
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
Imagine you have for example a website running on http and https. Your analytics may only run on https.
The default embed tracking code you get, looks for example like this:
This means on an HTTP page the tracking request will be sent, and then redirected to HTTPS. If the request is a POST request with a body, important tracking requests may get lost. For example some bulk tracking requests, requests with a longer tracking url (could be caused eg by heatmaps, form analytics, etc.), or requests that are queued which will be available soon in #13616
Something that could work to detect a redirect is eg
or something like this may work as well:
if a redirect was detected, we could maybe in the beginning retry and update the tracking URL internally only when there is for example a protocol mismatch (http vs https). At the least we could report such mismatches in the console.
I haven't tested it and neither thought too much about it, but could be quite useful to not lose any tracking requests.
The text was updated successfully, but these errors were encountered: