Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating visit dimensions might not work correctly in some cases #19316

Closed
sgiehl opened this issue Jun 3, 2022 · 5 comments · Fixed by #20600
Closed

Updating visit dimensions might not work correctly in some cases #19316

sgiehl opened this issue Jun 3, 2022 · 5 comments · Fixed by #20600
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Tracking For issues related to getting tracking data into Matomo.
Milestone

Comments

@sgiehl
Copy link
Member

sgiehl commented Jun 3, 2022

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

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. c: Tracking For issues related to getting tracking data into Matomo. labels Jun 3, 2022
@sgiehl sgiehl added this to the 5.0.0 milestone Jun 3, 2022
@tsteur
Copy link
Member

tsteur commented Jun 7, 2022

@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?

@mattab mattab added the 5.0.0 label Jan 4, 2023
@mattab
Copy link
Member

mattab commented Mar 14, 2023

@sgiehl Thanks for creating the issue. Regarding this part:

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.

Could you maybe list the steps to reproduce the issue and clarify what the problem is? Thanks!

@sgiehl
Copy link
Member Author

sgiehl commented Mar 14, 2023

If I remember correctly that happens when a referrer is updated within the same visits. So to reproduce I would assume it something like

  • Visits the page directly
  • Visit the page again coming from a non direct referrer
  • The referrer columns of the visit should now be updated to the new non direct referrer, but the referrer_url will stay empty (which it shouldn't)

@mattab
Copy link
Member

mattab commented Mar 24, 2023

@sgiehl Q: would it be possible to maybe fix this particular bug in a quicker way without having to do a broader rework?

@sgiehl
Copy link
Member Author

sgiehl commented Mar 24, 2023

It might. But we really should invest more time to get rid of our technical depts instead of introducing new onces with doing quick fixes only. If we try to save the time now, we will need to invest even more when we need to adjust the attribution later again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Tracking For issues related to getting tracking data into Matomo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants