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

Ability to add metadata to an event #134

Closed
metmarkosaric opened this issue Jun 22, 2020 · 21 comments
Closed

Ability to add metadata to an event #134

metmarkosaric opened this issue Jun 22, 2020 · 21 comments
Labels
feature request New feature or request

Comments

@metmarkosaric
Copy link
Contributor

metmarkosaric commented Jun 22, 2020

"When sending an event, it would be nice to attach arbitrary metadata to it. For example, I could send a “SignUp” event but add a formName property as metadata to track which sign up form they used. i.e { formName: “footer” } or { formName: “popup” }

Also need the ability to sort events by that metadata in the dashboard UI"

Update: Metadata for goals is now live! See instructions here: https://docs.plausible.io/custom-event-goals#using-custom-props

@metmarkosaric metmarkosaric added the feature request New feature or request label Jun 22, 2020
@lewisgoddard
Copy link

Categorizing events would be nice to.

@nicbou
Copy link

nicbou commented Jul 7, 2020

This is a major dealbreaker for me. I track outbound links, because my income depends on them. I can't create an event for every single URL in use on the website. If I could add a "URL" attribute to an "Outbound link" event, that would be perfect. Otherwise, I will have to look for another tracking solution.

@metmarkosaric
Copy link
Contributor Author

This is a popular request so we're considering to build it next (after we finish adding some new metrics over the next few weeks).
We do need some more info on the use cases for this in order to come up with the best solution possible so any feedback is appreciated. Here's what I'm getting from previous posts:

The original example above is clear. You create a goal (say Signup) and as you have the signup form on several locations of your site you add metadata to that specific goal (Signup: Footer and Signup: Popup). Then we display the "Signup" goal as we do now on the dashboard with total number of conversions and when you click on that goal you will see the individual split of conversions between "Footer" and "Popup" in the main graph and a table.

@nicbou example seems clear too: You create a goal (say Outbound click) and you add specific URL as metadata (Outbound click: domain1.com and Outbound click: domain2.com). We show "Outbound click" on the dashboard and when clicked to the goal conversion report you see the list of all the different individual domains (domain1.com, domain2.com...) with the number of clicks next to them in a table.

Would this type of metadata work for categorizing related events @lewisgoddard ? So in your usecase that @danrabbit mentioned in #184 (HTTP vs Magnet download). You would create one goal called "Download" and add metadata to that goal (Download: HTTP and Download: Magnet). Then you click on "Download" in the goal list on the dashboard and you see the goal conversion report showing number of downloads for HTTP and for Magnet in a table and the main graph.

All of the above basically means that we add one extra field to goals where you can add whatever you want as metadata. It could work for categorizing events into related groups, for comparing different events to each other and for doing A/B testing.

Is one extra field to each goal enough or do you see usecases where you might add more than one level of metadata to a goal?

Anything else you're thinking about?

Important we get it right from the start for the major usecases as it gets difficult to make big changes after something like this is live and in use. Especially consider we want to keep the code lean and light.

Thanks!

@lewisgoddard
Copy link

I think the largest we go is 3 deep, but 2 would work fine so long as the second takes undefined metadata.

  • Downloads
    • Method
      • HTTP
      • Magnet
    • OS
      • Windows
      • mac OS
      • Linux

This can be fairly easily compressed down:

  • Download Method
    • HTTP
    • Magnet
  • Download from OS
    • Windows
    • mac OS
    • Linux

@nicbou
Copy link

nicbou commented Jul 10, 2020

Personally, I am fine with two-level goals (name, metadata), as long as it's easy to filter and sort the goals by metadata.

For example, on All About Berlin, here are some questions I ask Google Analytics:

  • How many clicks did a specific URL get this month?
  • On which page does this monetised link get the most clicks?
  • Which external URLs get the most clicks?

@ehrig
Copy link

ehrig commented Jul 10, 2020

Personally one level would suffice for my current use case (adding metadata to a purchase). But as you mentioned you want to get this right from the start, I think providing a sub-metadata level, hence two levels of metadata, gives us more flexibility. The number of metadata I can add per level won't be limited, right?

@filmgirl
Copy link

Like @nicbou having outbound click tracking would be ideal for my use cases. I’m not always making money off of that kind of tracking, but it’s important for me to be able to track what are the most popular external links (in the scenario like a link blog/newsletter) that visitors click on. Matamo does this, but most other privacy-focused/simple analytics services don’t.

Having one level of metadata would be fine for my user cases (though two would offer more flexibility), I just would like to have a single attribute I could apply to all links, as @nicbou described, so that I could see what external links are clicked on the most. The big thing is I don’t want to have to create a new event for each domain or even for each page on my site. In an ideal world, I could create an event type called “outbound clicks” and then a list of each external URL.

@divinerites
Copy link
Contributor

I second this request.

As I use gohugo.io, it is very easy to generate automatically all the links I track.

But this means that I have to create manually all the variations (60) around my main interest in click.

A second dimension would greatly help reducing the number of manual creations I have to do.

@mehulkar
Copy link

mehulkar commented Aug 2, 2020

I was planning to just make my event name include the metadata, since my use case is simple, but I see that events don't show up unless you add Goals for them. Looks like #218 is similar to what I was looking for. Metadata would be ok also, but would definitely need some way to sort through that data!

@alpha077412
Copy link

Is there some way this could perhaps allow us to track revenue from a goal?

It would be possible to pass order value as metadata from an event such as "Order Created" on a checkout page. I guess the main difference is we would ideally want this number to be cumulative as a pose to the examples above where metadata is used for filtering.

Being able to track revenue from different sources and campaigns (particularly with PPC and other ad campaigns) is essential for myself and many others in e-commerce and really the only thing holding me back from migrating to Plausible completely.

@dgp1130
Copy link

dgp1130 commented Oct 23, 2020

Might be a little late to the party as work seems to have just started, but I would also like to point out the use case of tracking numeric values as well. Specifically, I want to track how far users scroll on a page. I noticed there is a specific issue for this (#121) but custom metadata can provide a more generic API to implement such a feature on top of. I want to be able to do:

const scroller = document.querySelector('...');
scroller.addEventListener('scroll', () => {
  debounce(() => {
    plausible('scroll', {
      height: scroller.scrollTop / scroller.offsetHeight,
    });
  });
});

Then in the Plausible UI it could show the average and distribution of all the scroll values per page. This would be really useful to know how far users got for a particular page. Though this particular use case would require taking the max value per page view, which might be difficult to express in a generic fashion.

Tracking numeric metrics could go beyond scrolling however. It could track the time on page, time to complete a user flow, average response times of backend requests, precise viewport size, number of items in the user's cart, etc.

Tracking scrolling happens to be my personal motivation, but I just wanted to bring up the use case for analyzing numeric metrics and how useful that can be. That would be a great feature add for Plausible which would unlock countless use cases.

dgp1130 added a commit to dgp1130/blog that referenced this issue Oct 23, 2020
I set up an account with the current prod URL (dwac.netlify.app) and copy-pasted the script into the page template which should be applied to every page.

The script itself is pretty minimal and is property asynchronous. It is supposed to include a `data-domain="dwac.netlify.app"` attribute, however it seems to infer the host origin if not specified. I don't want builds to be conditionalized on the environment they are being deployed to, so I would rather not put the origin in the actual source code. Letting Plausible infer from the current origin seems like the right behavior for 11ty on Netlify.

The one significant limitation I see is that custom events do not allow any special metadata. In particular, this means I can't track scroll depth on a page, which is quite dissapointing. I could potentially hack around this with explicit events for "quarter scroll", "half scroll", "full scroll", etc. For now, all this tracks is page views, which is a reasonable starting point. See: plausible/analytics#134.
@metmarkosaric
Copy link
Contributor Author

@nicbou @filmgirl @divinerites tracking outbound link clicks is now possible. we've automated the process so you don't need to manually tag all the external links. this feature is not enabled by default though so you need to follow this process to enable it for sites where you want to track external link clicks (you'll need to change the snippet and add one goal): https://docs.plausible.io/outbound-link-click-tracking

@divinerites
Copy link
Contributor

Sooo cool.
Will try and report. Thanks.

@divinerites
Copy link
Contributor

divinerites commented Nov 4, 2020

Fantastic !!

  • This works flawlessly & It doesn't affect the existing goal on those links.
  • I've already updated my hugo-plausible module to v1.8.0 to use this function with just a new parameter outbound_link = true

Many thanks. This is really helpful to simplify the configuration.

@metmarkosaric
Copy link
Contributor Author

great to hear, thanks @divinerites!

@divinerites
Copy link
Contributor

May be out of scope of this issue, but cleaning my scripts, I realized that I have a use case very close to this one.

I'm tracking the clicks on phone numbers, with the tel: protocol instead of external http:.

My be we can have a similar behaviour for tel: protocol without too much hassle/bloat on your side ?

@metmarkosaric
Copy link
Contributor Author

Metadata for goals is now live! See instructions here: https://docs.plausible.io/custom-event-goals#using-custom-props

You can also automatically track external link clicks by following instructions here: https://docs.plausible.io/outbound-link-click-tracking

@divinerites
Copy link
Contributor

divinerites commented Nov 7, 2020

where you want to track external link clicks

I don't know if it is expected but I have some reports for : javascript:void(0)

My source code (this is for image magnifying) is : <h4><a href="javascript:void(0)" title="link javascript">{{ .title }}</a></h4>.

@divinerites
Copy link
Contributor

divinerites commented Nov 7, 2020

Oops sorry. This issue is closed. I will open a new one.

@jgonera
Copy link

jgonera commented Mar 16, 2021

@metmarkosaric Are there any plans to support what @dgp1130 mentioned in #134 (comment)?

@ukutaht
Copy link
Contributor

ukutaht commented Mar 17, 2021

@jgonera Yes, see more discussion here: #810

We haven't prioritized it on the roadmap but it's definitely something to work on in the near future.

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

No branches or pull requests