Coder Social home page Coder Social logo

Comments (4)

monsieurtanuki avatar monsieurtanuki commented on July 17, 2024 1

@monsieurtanuki your solution is smart and seems perfect :-)

With such an enthusiastic comment I was somehow forced to code it today 😉

from smooth-app.

alexgarel avatar alexgarel commented on July 17, 2024 1

@monsieurtanuki because it will take time to deploy this fix to every one, I am manually patching matomo to do the same.

from smooth-app.

monsieurtanuki avatar monsieurtanuki commented on July 17, 2024

Do not define user id (uid) for anonymous stats and instead use a random visitor id that change on every requests.

I didn't follow everything regarding matomo but it looks like we put the same value for conceptually different IDs: the visitor ID (e.g. the device id) and the visitor user ID (e.g. the user email).

I assume that what is bothering you is the visitor ID, that uses one single bucket ('0') for all non-consenting users on the server side.
It also look like you're not supposed to change the visitor ID.
A quick fix would be to compute a random letter, to store it locally, and to reuse it as the start of the visitor ID (right-padded with 0s) when the user is not consenting. Dividing the world of non-consenting users in 26 evenly distributed regions.
@alexgarel What do you think of that?

Food for thoughts:

cf. matomo.dart:

  /// The [visitorId] should have a length of 16 characters otherwise an
  /// [ArgumentError] will be thrown. This parameter corresponds with the
  /// `_id` and should not be confused with the user id `uid`. See the
  /// [Visitor] class for additional remarks. It is recommended to leave this
  /// to `null` to use an automatically generated id.

cf. visitor.dart:

  /// The unique visitor ID, must be a 16 characters hexadecimal string.
  ///
  /// Corresponds with `_id`.
  ///
  /// Every unique visitor must be assigned a different ID and this ID must not
  /// change after it is assigned. If this value is not set Matomo will still
  /// track visits, but the unique visitors metric might be less accurate.
  ///
  /// Think of this as a device ID; in case of website tracking (where Matomo
  /// originates), this would be the cookie identifying the browser and not
  /// necessarily a user (since a single browser might be used by multiple
  /// users).
  final String? id;

  /// The [User ID](https://matomo.org/guide/reports/user-ids/) is any non-empty
  /// unique string identifying the user (such as an email address or an
  /// username).
  ///
  /// Corresponds with `uid`.
  final String? uid;

from smooth-app.

alexgarel avatar alexgarel commented on July 17, 2024

@monsieurtanuki your solution is smart and seems perfect :-)

from smooth-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.