How long before events are reported?

Trying to work on a custom event intgeration but events don’t seem to track on Matomo in real time.

How long does it take before an event is reported?

Custom code we are using right now to trigger events is:

$url = add_query_arg( array(
    'idsite' => 3,
    'rec' => 1,
    'e_c' => 'Contact',
    'e_a' => 'Contact Form Click',
    'e_n' => 'Contact Form Submission',
    'e_v' => 1,
), 'https://DOMAIN/matomo.php' );

$response = wp_remote_get( $url );

Appreciate any help anyone can provide on this :slight_smile:
Thanks

You have access to real time tracking in menu Dashboard > Visitors > Real-time.
Regarding your code, I am not expert on the PHP side. I will let someone else reply…

Hmm interestingly I can’t get my visit to appear in the real time log. I can see other visitors within minutes so this report doesn’t seem to be delayed.

Any ideas why my visits might not be appearing? I tried in Chrome normally, in a private browser and tried clearing all cookies incase I had the cookie to ignore my visits.

Could it be ignoring my IP?

In Administration (cog) > Measurables > Manage > (selection of your site) > Excluded IPs, there is a list of excluded IPs
Does your request work on Chrome? From the same computer than the PHP server executing your PHP code?

Also, according to Tracking HTTP API: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v4, you should also provide:

Recommended parameters

  • action_name (recommended) — The title of the action being tracked. It is possible to use slashes / to set one or several categories for this action. For example, Help / Feedback will create the Action Feedback in the category Help .
  • url (recommended) — The full URL for the current action.
  • _id (recommended) — The unique visitor ID, must be a 16 characters hexadecimal string. Every unique visitor must be assigned a different ID and this ID must not change after it is assigned. If this value is not set Matomo (formerly Piwik) will still track visits, but the unique visitors metric might be less accurate.
  • rand (recommended) — Meant to hold a random value that is generated before each request. Using it helps avoid the tracking request being cached by the browser or a proxy.
  • apiv (recommended) — The parameter &apiv=1 defines the api version to use (currently always set to 1)

Hi,

It is probably the best to (temporarily) enable tracking debugging:
https://developer.matomo.org/api-reference/tracking-api#debugging-the-tracker

because then the request will return a verbose log on how and why the request is (not) stored.