Track event missing url

We are tracking job postings using the matomo/matomo-php-tracker where we have set up goals to track the submission of job postings using the doTrackEvent. The events register in Matomo as a Direct Entry. We want to track the submissions using the page URLs where we have an overview with a column of the conversions, but those do not update. We’ve set the URL in the MatomoTracker instance, but it does not appear to be linked to the event.

What are we doing wrong?

it’s a while since i used matomo-php-tracker, but i remember this problem. you could add the page URL to the event’s metadata, like

$tracker->doTrackEvent('Job Posting', 'Submit', 'Job Submission', $jobId, array('url' => 'https://example.com/job-posting-page'));

if that helps you?

ChatGPT proposal: you can set a custom URL before calling doTrackEvent, it links the event to that url:

$tracker->setUrl('https://example.com/job-posting-page');
$tracker->doTrackEvent('Job Posting', 'Submit', 'Job Submission', $jobId);

this is untested code…

We already set the use correctly and do what you have found with ChatGPT,

the doTrackEvent function only accepts the following Parameters:
string $category – The Event Category (Videos, Music, Games…)
string $action – The Event’s Action (Play, Pause, Duration, Add Playlist, Downloaded, Clicked…)
bool|string $name – (optional) The Event’s object Name (a particular Movie name, or Song name, or File name…)
bool|float $value – (optional) The Event’s value

It does not appear to be possible to add metadata to the event.