At present a Custom Dimension needs to be set before a pageview tracking request is sent. If it is not set before, then a pageview tracking request needs to be sent in order for it to be tracked.
However, the ping tracking request from the hearbeat timer (Or manually triggered) includes the Custom Dimension in the tracking request in order to get an accurate "Time on Dimension" for Actions dimensions (Not sure about Visit Dimensions).
It might be really useful if this could be used to track a new Custom Dimension or to update an existing Custom Dimension in the same page without needing to send a new Pageview tracking request.
At present Matomo seems to ignore the updated dimension if its changed or if a new one is tracked.
Eg. a Pageview request after a dimension is set to 1
:
And then a ping
request after it was updated to 2
:
Doesn't get updated in the visit log: