-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hi there!
Using this package with Fastify server in Node@20. I'm building all the parameters for tracking my user like this:
const umami = new Umami();
umami.init({
hostUrl: process.env.UMAMI_HOST,
websiteId: ...,
userAgent: req.userAgent.source,
});
const url = new URL(req.url, `${req.protocol}://${req.hostname}`);
const { hostname, pathname } = url;
const language = req.headers["accept-language"];
const { referrer } = req.headers;
umami.track({
hostname,
screen: "1920x1080",
language,
title: `/Home`,
url: pathname,
referrer,
});
This is working just fine, I'm getting all the information in my dashboard. Unfortunately when I add a custom event name, suddenly all the other information are missing, and I get only the event tracking:
umami.track({
hostname,
screen: "1920x1080",
language,
title: `/Home`,
url: pathname,
referrer,
+ name: "My event"
});
I worked around this issue by calling track()
twice: once with the generic tracking information and once with my custom event only:
umami.track({
hostname,
screen: "1920x1080",
language,
title: `/Home`,
url: pathname,
referrer,
name: "Button clicked"
});
umami.track("My event");
I should not be forced to do that, right?
Thanks!
NOTE: I'm importing the Umami class instead of the default import because it doesn't work, I can open another issue if you wish.
boly38
Metadata
Metadata
Assignees
Labels
No labels