Need some advise and pointers on tracking an API

Hello,

I have Matomo installed on a server. All works fine.

On another server I have several API I created.
One serves updates for a WordPress plugin I sell.
Another does Geo Targeting.

I collect some basic stats internally and make that visible to the accompanying WordPress site.
But now I have Matomo… I’m considering switching to tracking in Matomo.

I have the tech pretty much figured out, but here’s my doubt.
I tracked requests and usage for a few hours and it wasn’t a very comprehensive report.

So I probably am missing things in my recording.

Looking at the various API documentation I see there are tons of variables I can send.

But if I want to know basic usage stats and which API they use, using a certain plugin and which API version they use what data should I sent to make a comprehensive report in Matomo.
Do I send campaigns? Or events? And which variables are recommended as a minimum for a good “visit” recording.

For example to the Update API I’d use this tracking code:

`require_once "matomo.php";
$matomo = new PiwikTracker($idSite = 1, $apiUrl = 'https://my.matomo.setup/');
$matomo->setTokenAuth('my_fancy_token');
$matomo->setUserAgent('API; Updates '.$api_version);
$matomo->setLocalTime(date("H:i:s"));
if($action == 'basic_check') {
	$event_action = 'Check from '.$plugin_data['name'].' '.$args->version;
} else if($action == 'plugin_information') {
	$event_action = 'Info Popup for '.$plugin_data['name'].' '.$args->version;
} else {
	$event_action = 'Unknown action by '.$plugin_data['name'].' '.$args->version;
}
$matomo->doTrackEvent('API', 'Update', $event_action, false);`

And for the Geo Targeting API I’d use:

`require_once "matomo.php";
$matomo = new PiwikTracker($idSite = 1, $apiUrl = 'https://my.matomo.setup/');
$matomo->setTokenAuth('my_fancy_token');
$matomo->setUserAgent('API; Geo '.$api_version);
$matomo->setLocalTime(date("H:i:s"));
$matomo->doTrackEvent('API', 'Geo Targeting', 'Lookup', false);`

Thoughts? Advise?
Thanks.