Time tracking based on action

I like to set time tracking based on Matomo analytics. Is it possible to get PHP variable value as it will be used as CTA.