Seems like a basic question but haven’t yet found an answer: What’s the standard way to track Matomo goals in Wordpress?
I see the official docs reference the API, but without goal-specific examples, or an example script to use with the API request.
Do I need to write a short JS function to execute the AJAX call to the API? What does a goal-triggering REST API call look like (minimum required parameters)? Any docs on this specific topic? Thanks.
You can simply call _paq.push(['trackGoal', 1]); (with the ID of the goal) whenever you want to track the goal and the Matomo Javascript sends the right request to the API.
The Matomo reporting API (which allows you to view any report in Matomo in easily-usable format) has nothing to do with the Matomo Tracking API (which is the endpoint where tracking data is sent to).
And this again is separate from the Javascript functions one can use when using the normal matomo.js tracking client.
All three are explained on https://developer.matomo.org/api-reference