@sgiehl opened this Issue on June 3rd 2022 Member

Matomo uses so called Dimension classes to determine which database fields needs to be set/updated in the log tables.
Each Dimension class can contain several hook methods that are called depending on the visit/action currently handled.

When such a hook is triggered, we currently iterate over all dimensions and may update the dimensions value directly.
This may lead to unexpected behavior when other dimensions, might try to work with the value of a dimension, as it depends on the order of the dimensions if the value might be the initial one, or if it might be updated already.

Currently this makes problems when updating the refererr. This happens when the initial referrer was detected as DIRECT and an onoging action send another referrer. As the referrer_type dimension is updated, before the referrer_url property, the url stays empty.

See discussion in #19250.

We need to rework the dimension / property handling of visits in Matomo 5 and decide if we want to introduce some sort of dependency, that ensures properties that depend on others are updated later. And methods like getPreviousVisitColumn and getVisitorColumn show be renamed/refactored so it's clear weather they return the initial or updated property value or even the property of a previous visit.

follow-up to #19250

@tsteur commented on June 7th 2022 Member

@sgiehl be great to add a comment to what this means for the users from their perspective? When and what data be impacted there for them? I understand also from your other comment that if initially the referrer was detected as direct, and then the referrer changes, then the referrer type is detected correctly but the URL stays empty?

Is this only an issue when create_new_visit_when_website_referrer_changes=0 as we'd expect a new visit to be created in that case maybe anyway? Or is it the new visit that is then having this issue?

Powered by GitHub Issue Mirror