Matomo Heartbeat

I am using matomo for wordpress and it keeps showing the time spent on the last page of the visit as 0 seconds. I have enabled the heartbeat to ping every 5 seconds but it made no difference.

Is there anyway to fix this?