johsin18 / DevicePixelRatioMatomoPlugin

3 stars 1 forks source link

Update DPR if it changes during a visit #3

Open seb303 opened 6 months ago

seb303 commented 6 months ago

I saw in your FAQ that you are open for a good argument to update the DPR for subsequent tracking events in the same visit.

Our use case does in fact need this (and actually also for the Core Resolution value too). This is because we are using only server-side API requests to record everything. The screen size and DPR are passed to our server by a small piece of our own Javascript code, but we don't receive this info until after the first page impression of a user session. So for the first page impression of a visit there is never any value for the DPR (or Resolution).

Here's more discussion about this: https://forum.matomo.org/t/resolution-get-stuck-as-unknown-if-not-set-with-first-tracking-event/56079

It would be great if you could add an option for this in your plugin - and perhaps this option could also affect the Core Resolution value?

seb303 commented 6 months ago

Have submitted a PR to address this.

Also for core Resolution plugin: https://github.com/matomo-org/matomo/issues/22079 https://github.com/matomo-org/matomo/pull/22080