umami icon indicating copy to clipboard operation
umami copied to clipboard

Allow setting custom data on autotracked pageviews via data attribute on script element

Open gwennlbh opened this issue 1 year ago • 6 comments

This would allow setting custom data, like Plausible allows with what they call "Custom Properties".

This is very useful to track how much people are on e.g. a version, how much people use the dark theme, how much pageviews are from logged-in users, etc.

An example of what it looks like in the dashboard:

image

gwennlbh avatar Dec 16 '23 23:12 gwennlbh

@ewen-lbh is attempting to deploy a commit to the umami-software Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 16 '23 23:12 vercel[bot]

I added a way to show those custom fields on a website's dashboard. I also excluded pageview custom data from the custom data tab, since it doesn't make much sense and would pollute that tab with lots of events.

For now you can add these custom data tables on the dashboard via the URL: ?fields=comma,separated,field,of,event-keys

I'll add a selector in the UI but it requires much more changes

gwennlbh avatar Dec 17 '23 02:12 gwennlbh

very cool feature, will this be merged soon?

timomayer avatar Dec 22 '23 07:12 timomayer

@timomayer if you want to use it right away, I've been using my fork in production for a few weeks now with no issues.

The annoying thing is that there's nothing in the UI yet to actually choose what custom properties to show, you have to pass them via the query parameter.

And also there are some places where you would expect custom properties to show up (e.g. on reports, etc.) but they only appear on the dashboard for now, and you also can't filter by a custom property's value. It's rudimentary but this is still better than Plausible, that outright denies access to this feature on self-hosted instances.

gwennlbh avatar Dec 28 '23 08:12 gwennlbh

PRs are usually made against the dev branch. You are doing it against the master branch directly, if I am not mistaken, despite it being the default branch you should change your PR against dev.

israelozarate7 avatar Jul 23 '24 15:07 israelozarate7