Implementing Tracking HTTP API

I want to use my Matomo self-hosted installation in a similar way to the Google Analytics Measure Protocol - its equivalent in Matomo being the Tracking HTTP API.

My current understanding is that there already exists for frontend tracking with Javascript using the wp-matomo WordPress plugin, I don’t know if this is still maintained and don’t believe it supports Tracking API, only Reporting API. I don’t know if this is an official/unofficial plugin.

There is also PHP Tracking Client. Is there any recommendation for converting/building a GA/new plugin for WordPress as to which I should use, or perhaps someone else has implemented a solution and would be willing to share examples?

Thanks,

Rich

Hi @rpharrison

Thank you for your message.
Wp-matomo plugin has been developed by the community.

You could probably start by having a look at our php tracker API https://github.com/matomo-org/matomo-php-tracker.
Kind regards

Mat

Hi @Matthieu_Mary

In the end I modified an open-source plugin which provides PHP tracking for GA, which for the most part is working pretty good. For some reason it seems to be counting link rel type links in the html source and adding these as extra hits in the same pageview.

The plugin used as a base is: https://wordpress.org/plugins/ga-backend-tracking/

Thanks,

Rich

Hi @rpharrison

It’s quite difficult to answer you as we are not aware of this plugin.
If you could be more precise we could help you but in this case this plugin study is out of this support scope.
Kind regards

Mat

Thanks @Matthieu_Mary

I appreciate that you’re not able to support this plugin directly. But just for reference I’ll include an example api request that is sent to Matomo. I suspect I may be mixing up parameters.

https://analytics.mysite.co.uk/matomo.php?apiv=1&url=https://www.mysite.co.uk/services/example-service/&ua=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36&cip=...&idsite=5&rec=1&token_auth=****************************&urlref=https://www.mysite.co.uk/&rand=1234567890

I resolved the issue I was having, a theme-related problem. So everything appears to be working well.