Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See on which pages an event was fired #749

Open
FabulangTeam opened this issue Jun 21, 2024 · 2 comments
Open

See on which pages an event was fired #749

FabulangTeam opened this issue Jun 21, 2024 · 2 comments

Comments

@FabulangTeam
Copy link

Perhaps I'm missing something, but it seems like unless you track the page path as part of the event name, there isn't a way to see on which pages a given event fired?

A hack solution for now could be to set the referrer to the current page using goatcounter_referrer, and use the referrer list to identify the pages on which the event ran. But this doesn't work for events fired by JS.

As a possible simple addition(?) that would allow the above hack to work universally, could we be allowed to specify the referrer in JS events as well? e.g.

window.goatcounter.count({
  path: 'name,
  title: 'Name',
  referrer: '/page',
  event: true
});

Arguably, this ISN'T a hack – as quite arguably the page on which the event fires IS its "referrer".

@arp242
Copy link
Owner

arp242 commented Jun 23, 2024

Internally events are "just" pageviews, but with event=true and without the requirement that the "path" (event name) starts with /. Other than that, it's treated pretty much identical.

There isn't really any way to do what you want other than using the referrer. Maybe it should be doing that by default and/or the UI could be clarified on this 🤔

@VirgilThinks
Copy link

@arp242 Yes, what do you think, perhaps the default for an event's referrer should be the current page? In many ways that makes more sense.

Either way, it would still help if there was feature parity between JS events and data parameter events, so that the referrer can be overridden in both methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants