MatomoTracker.php PHP Tracker implementation

Hello All. I’m following up from a previous post regarding using the MatomoTracker.php. I’m trying to get a Click event registered to my Matomo install using the:

// – Matomo Tracking API init –
require_once ‘/home3/XXXXX/public_html/XXXXXXXXXvo/XXXXXXXX/Matomo/PiwikTracker.php’;
MatomoTracker::$URL = ‘’;

Additionally, I have successfully called the tracker for various functions which seem to work perfectly: But the elements that should fire from a click are fired on PAGE LOAD - not from being clicked.

BUT, I seem to be having a problem having Video/Audio content sending an Event from a “Click” on the various videos, images, or audio.

The doTrackEvent fires when the page is “LOADED”, and not when the content it “CLICKED”

Can someone provide an example - or at the very least - point my in the direction of documentation that might help me achieve sort of an OnClick Event (but without the JS) and using the MatomoTracker functions? I’ve read the existing documentation ( and can’t figure out the on click event (as I’m not a coder myself)

Thanks so much in advance for any help!

Can anyone help with this? I’m trying to register a Click event on images in an email template that is generated on a server different from the Matomo installation.