Tracking with JS, read utm_campaign with PHP


I have a website where I do tracking with Matomo 4.4.1 using JavaScript.
The website is linked with

Everything works perfectly well and the campaign is tracked in the Matomo backend.

But now I have a problem I was not able to solve:
I need to read the utm_campaign value with PHP on the website for some advanced statistics.

Currently, for all orders an employee goes to the Matomo backend, reads all orders with timestamp and campaign code and reports it back to our CMS/ERP manually.
I want to report the campaign code to to CMS/ERP automatically, when the user orders a product from the shop.

What I did so far:
Added the Matomo PHP Client to the webshop, initialize it and read getAttributionInfo but it is empty.

$matomoTracker = new MatomoTracker(10);
$order->setUtmCampaign( $matomoTracker->getAttributionInfo() );	

I guess there is something like this missing:

$matomoTracker = new MatomoTracker(10);

but there is no such method :slight_smile:

What can I do? Is this possible at all?

The workaround would be, to read the value with the JavaScript Client and set a hidden input field on the order page, but this seems like a dirty hack to me.

Thank you!