Noticed only in https://github.com/matomo-org/matomo/issues/15593#issuecomment-640388105 that it's actually not exposed. As we need this in one of our projects ourselves adding this to 3.x-dev. Will reference that PR where we use it as well. Had this already implemented in another repo not knowing it wasn't working.
we'll also need to document this afterwards on the JS tracker API.