Tracker or Querystring parameter "r" - Significance


(Siva Kumar Rallabhandi) #1

Hi All -

In the JS tracker, or in the tracking requests, we see that there is a parameter that is getting sent to Matomo, as

‘&r=’ + String(Math.random()).slice(2, 8) + // keep the string to a minimum

This is actually from the tracker code.

Not sure of the significance or use of this. I don’t see the documentation to this parameter reference in

https://developer.matomo.org/api-reference/tracking-api

Also this is not used in the “Request.php” file while processing contents in the Matomo server.

If this is not used, can we just remove this from the query string parameters, and avoid any confusion to anyone else, and have less data being sent to the Matomo tracking servers.

Thanks in advance.

Regds,
Sivakumar


(Lukas Winkler) #2

Hi,

I’m pretty sure this random string is not used in any way on the server and is only for the case that you have a misconfigured webserver that caches every GET request in front of Matomo.

Update: Seems like this parameter has been Part of Matomo for as long as I can go back in the source history (10 years)


(Siva Kumar Rallabhandi) #3

Thanks much Lukas for the prompt reply. Are you saying that this is still needed in the product?


(Lukas Winkler) #4

Matomo doesn’t need this string, but if you have configured your webserver to cache identical requests then the second time someone tracks the same data it won’t reach Matomo.


(Siva Kumar Rallabhandi) #5

Thanks a lot Lukas for the explanation and your time.