matomo-org / matomo-nodejs-tracker

A Node.js wrapper for the Matomo (Piwik) tracking HTTP API
MIT License
117 stars 42 forks source link

Support matomo.trackEvent #55

Open rodinhart opened 5 years ago

rodinhart commented 5 years ago

It would be useful to track custom events from nodejs.

Toub commented 4 years ago

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:

More examples in README page would be helpful.

Cayllen commented 11 months ago

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