-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
User-ID: Unique Visitor is not recognized even with the same User-ID #15593
Comments
This is intended. Since the referenced change the UserID no longer influences the visitor ID or visit ID. |
Is this really what we want? In this case, the User-ID has no more added value than a named CustomDimension. I think the primary use-case is the cross device recognition of users. I know many instances where the User-ID is used and it is always for this case. If you want to record a User-ID for a visit, decoupled from user recognition logic, one could simply use a custom dimension. Using a forced visitor-ID does by far not offer the same flexibility as the User-ID did. And speaking of semantics - User-ID, in my opinion, implies, that's a single user, using multiple devices or is tracked in different places. Therefore it must be the same visitor (in analytics terms). Dimension definitions from my point of view:
The proposed use-case from #13620 |
ping @mattab I'm not so much into this topic. I suppose it wouldn't help to do something like I suppose in general the idea was maybe also that you can see what a user did before logging in and after as part of the same visit? But indeed tracking cross device is getting more complicated. |
Thanks for the report @peterbo!
That's a good point 🤔 In general it was on purpose to generate separate visits on each device for a same user, but in retrospect I see what you mean that it has become more like a custom dimension and not as valuable maybe.
Yes this could help you @peterbo if you run this code in JavaScript, and then on the server-side you also get to generate the same Visitor ID. It might be the easier solution in your case. another solution be to get the Visitor ID from your visitors and store it in your DB for each visitor/user, and then set it again when tracking the conversion server-side.
Yes, it was the idea also, and an advantage of changing the implementation... What do you think? Pending tasks/bugs
|
Hey @mattab thanks for the feedback!!
Making it work again is not a problem. Unfortunately, it's not that easy, because we can't execute business logic on the external endpoints. But I can create a plugin that changes recognition logic. That's not really the Problem.
That's a valid point. However, this is an adjacent use-case to all other uses, and, from my understanding, can be achieved easily with simple CustomDimensions. But also in this case, it doesn't make sense (at least to me) not to recognize the unique visitor again.
That's what I'd have expected as well. Then the feature would also work for cross device. Decoupling from Visitor-ID is not a bad idea per se, but I feel that, at the moment, the feature is drifting in between use cases and not at all easiy to understand for the average user. Perhaps would be good to have a "default" behavior which can be configured towards a use case for advanced users? |
Feel free to create a separate issue with your thoughts for this 👍 Still pending tasks/bugs as part of this issue
|
@mattab what is the benefit of the current userId behaviour of a custom dimension? If there's no clear benefit, I would 100% vote to change behaviour back to original behaviour and no flags on how things work. |
I doubt that Matomo Core would be able to handle that (a returning visitor flag for a different visitor ID). E.g. Visitor-Log: A visit is flagged as returning and when you open the Visitor profile, you will only see one visit. This will probably also be the case for visitor based report archiving (being flagged as returning visitor but counted as two unique visitors) -> returning visitor reports will be distorted. For really decouple visitor ID from user ID and really adding value, probably some core modifications (archiving, visitor log, etc.) would be necessary. This would be part of a new ticket. So at the moment, in my opinion, rolling back or creating a config setting for a default behaviour would be the best options. What do you guys think? |
Why revert it? If you want the old behaviour just set the visitor id manually. |
Wrong. For example in my setup Matomo runs in its own subdomain matomo.domain.com and the matomo sites are other subdomains and paths on the same domain. In this setup the 3rd party feature works very well with all browsers and is very useful to connect the different matomo sites (over 50). So 3rd party cookies are in fact working very well. (and I also have invested a lot of time to fix all the bugs in Matomo related to them) |
Great, so go ahead and create that patch like I did instead of asking to have the work of others removed and break their setup because of your edge case. |
Thats probably not a 3rd party cookie but a wildcard cookie that you setup with the scope *.example.org?
Generally, this would be easily possible by adding new_visit=1 once to a request that also includes a User-ID: '_paq.push(['appendToTrackingUrl', 'new_visit=1']);' - but I'd rather like to solve this for both use cases.
That's why we're here. To discuss options and added value, not blindly execute. Hence, it would be great if you would contribute in the discussion of use cases and how we could create a feature that is good for different use cases and not break 50% with a minor update. |
Technically yes, but it works using Matomo's "3rd Party Cookie" feature.
If one is using the official Matomo JS API yes, but my 50+ Matomo sites are managed by many different teams, some using their own API, some using Pixels, etc, etc,. It would be a big pain and take a lot of migration time to move to this new way to do it.
Yes, that is why I am here. Basically having a per-site setting to switch between the two userid behaviors would be totally fine for me. Actually my first pull request had such a setting and even defaulted to the old behavior. |
Well, that's exactly the situation, I (and probably others) find myself in now. I also service a lot of instances with around 10k Sites. Just a few dozen of them are using the User-ID feature, but all of them rely on a recognition by User ID over visitor ID. So you could imagine the pain and work that has to be done.
Another comment to that statement. This not any edge case but the reason to introduce the User-ID feature in the first place. So generally, it'd be good to keep it stable, especially within minor version updates. But that's something, we already all agree on, so lets look ahead towards the resolution. I'd be fine to make this a config setting - @tsteur @mattab what do you think about that? |
we'll need to think more about it. Might take a while. @peterbo I'm not sure about config setting. it would be better to find the optimal solution that fits most use cases. Maybe we can make (almost) everyone happy with a few tweaks to bring back the usefulness of User ID. |
I'm trying to understand the thoughts here. What is to your opinion now the difference between userId and a custom dimension? And why was it changed? It seems to be 99% of users likely don't use 3rd party cookies and it was made worse for them but maybe I'm missing something.
I'm actually not sure we're doing that currently, or are you saying it should? Really just trying to understand things here. I don't really understand yet why the current behaviour is better for 3rd party cookies and why it was previously not good. Can any of this behaviour maybe achieved with a plugin? |
In that case, would you be able to use the
I guess the benefit is that, a visit on mobile will appear separately from a visit on desktop. Before the change, the interactions across mobile and desktop visits were merged into one. Whether it's a benefit is not clear however... as Peter points out (and a few other people by email) it's complex to update Mobile Apps and other SDKs to set the proper Visitor ID based on the web visit (or as a hash of User ID) etc. What would a "revert" look like?Would reverting this be as simple as reverting this PR? ea5a14b |
Could we maybe assign this to 3.13.4? |
@mattab there were also few other follow up PRs and also in PHP SDK etc. Not too many I think.
I seriously thought that those merged across devices into one visit (cross device tracking) was the purpose of userId. Re 3.13.4 depends. Would maybe need to go in a 3.13.5 if needed |
👍 |
Different sites use different first party cookies, how would that help? How would that cause different sites to use the same visitor id? Note: I have deleted some comments I made after this post, because I went too far with them. Reverting a change that took months to get merged and telling me to use "setCookieDomain" which does not help at all is, let us say... a bit harsh. |
In any case, we should keep the fix that avoids overwriting the global visitor id (_pk_uid) with the user id. If not, if any site messes up the setUserId() call (for example giving every logged out user the same id), it will break the whole Matomo setup for all sites. |
A compromise could be to generate the visitor id from the user id, but to have multiple visits for each device. What do you think? @mattab @tsteur @peterbo However, this still creates the problem, that it basically breaks any per-device tracking. I really feel we should have a setting for this. |
Hi everyone, I'd like to heat up the discussion again for this topic, since a lot of instances can not be updated at the moment. @tsteur did you already make a decision how we should proceed with this issue? |
I have not really any preference as I'm not so much in the topic. But wondering:
By default, I reckon more users would want the userId and visitor linked I suppose and use it for device tracking. Other SDKs would need to implement a similar behaviour. Not sure if that would work though. Alternatively, we could add a setting to the whole thing in the backend instead of in the tracking SDK (might make more sense) |
I agree with @tsteur . If we change it in the trackers/sdks this will be more work and maybe a bit confusing for the users, because the behavior will depend on sdk version and not Matomo version. On the other hand, if we change it in the Matomo Backend/Core, it would be less work and easier to understand for the user. In that case I would have less/no work for additional patches. For me both solutions are okay, as long as I can set the default behavior globally in Matomo Core. |
+1 for changing in core. Tracker behaviour should not be made more complex in my opinion. I think that using the userID field without any added value over the Custom Dimensions is still a confusing approach, but restoring the original behavior and being able to activate the alternative functionality of the userId could be a good compromise. |
Just fyi we deployed this yesterday @mariusk let me know if it's not working for you and I can follow up |
@tsteur Thanks. I've re-deployed my updated user tracking code and this time around at least it works (doesn't crash the client). Fingers crossed! |
@tsteur Another possible improvement related to this would be to avoid throwing an error when the |
@mariusk Hey Marius, it'd be great if you could clarify this topic via the forum / support ticket, because this is no more related to the ticket and quite a bunch of people are getting notified of new messages here. |
@peterbo Should be fine. Anybody following this ticket and attempting the same workaround will get smacked by the Matomo client throwing an error about the missing function, as reported (and confirmed) earlier. But only until everybody gets the updated Matomo client. I'll leave it for now and fingers crossed, it should all be good within a short time. |
Thanks everyone for the discussion, that's really helpful. Suggested steps:
Potential issues with this solution:
|
Tentatively assigning to Matomo 4 |
@peterbo @MichaelHeerklotz @mattab @mariusk do I see this right it might be as easy as this? https://github.com/matomo-org/matomo/pull/16124/files. (it is basically reverting the changes from https://github.com/matomo-org/matomo/pull/14360/files based on a setting ) Could someone test this and have a look? If it was indeed that easy then we could potentially also apply this to 3.x maybe but have the feature disabled by default to not again regress anything within a minor or patch release. |
@tsteur Looks good 👍 Thank you. |
@tsteur A bit late to the party here. I rewrote our code to set |
I'll move this into RC now to remember that we update the docs later closer to the release. Not changing them just yet to not have docs out there that only work for 3.X |
Will this fix not be backported to the 3.x branch? |
Great!! Thanks @tsteur, will check / live test the code tomorrow! |
This issue is closed but the new setting is set to 0 by default: Next step may happen via #15440 (comment) Edit: this is fixed in Matomo 4.0.0 beta1 👍 |
Hi i'm aware of the problematic and this solution works for me (for now). But i'm still missing the 'real' or 'right' solution for Cross-Device tracking. Is there any? The old behavior falsifies the Visitor-Id. The new behavior makes Cross-Device Tracking impossible. ... so what to do now? P.S.: Sorry, if this is not the right place for this question. But this isn't a real new issue and i don't know where else to ask. |
Cross device visitor recognition should work with |
I'm setting a User-ID, when a user visits a given Site. On a certain action, I'm triggering a goal serverside with his User-ID as a parameter (and a token). Effect after the Update from 3.12 to 3.13.2 is that the serverside triggered action is not only stored in another visit (which would be ok), but also fails to recognize the web-visitor with the same User-ID. For reference, the before/after screenshots:
Before (Visitor recognized -> new visit but returning visitor):
After (Visitor is not recognized -> Visit is not returning -> new visit and new visitor):
Serverside call:
https://example.com/piwik.php?token_auth=XXX&cdt=2019-08-07 18:56:10&idgoal=3&revenue=1234&idsite=X&rec=1&r=13454&uid=1234567890
In config, trust_visitor_cookie is disabled.
The reason for that is this change: ea5a14b#diff-6700aaf1ce500fe51e284b9ec6f01b01
The change works in the right direction, but now, a User-ID is only assigned to the same visitor, when also the config_id matches. This doesn't make sense, because the main use case is for example a user who logs into a website with different devices (GDPR aside, but the User-ID is for example the customer ID). This user should be recognized as the same visitor (not necessarily the same visit, but at least the same visitor). @MichaelHeerklotz
Refs #14360
The text was updated successfully, but these errors were encountered: