matomo-nodejs-tracker icon indicating copy to clipboard operation
matomo-nodejs-tracker copied to clipboard

Support matomo.trackEvent

Open rodinhart opened this issue 5 years ago • 2 comments

It would be useful to track custom events from nodejs.

rodinhart avatar Jan 16 '19 14:01 rodinhart

You can send custom events that way:

matomo.track({
    url: pageUrl,
    e_c: category,
    e_a: action,
    e_n: varName,
    e_v: varValue,
});

If you don't provide url, the server refuses the event::

[07:50:59] [ERROR] Unexpected error 500: AssertionError [ERR_ASSERTION] URL to be tracked must be specified. at [proc-1][router][rx-router.service.ts]

While the documentation specify that url is a non-required parameter:

  • url (recommended) — The full URL for the current action.

More examples in README page would be helpful.

Toub avatar Jan 06 '20 09:01 Toub

Same problem, is there a reason a URL is necessary or can this now solved differently?

Cayllen avatar Nov 28 '23 21:11 Cayllen