-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow custom event timeseries in stats API #3505
Conversation
Yes I think the limitation at the moment if fairly artificial. The main downside is that we cannot include imported data in the We can integrate this PR if:
|
Thanks for feedback!
We are building a rudimentary ad service for a website where we already use Plausible for traffic analytics. The clicks on the ads are tracked as custom events, and the (numeric) identifier of the ad is added as a custom property to the event. This way we are hoping to be able to answer questions using Plausible's stats API like "how many times was a given ad clicked in total", or "what was the distribution of clicks for each day since the ad is live". The latter is currently not possible, hence this change proposal.
According to the docs,
Yep, happy to do that, but wanted to confirm the change is sensible beforehand. Have a nice weekend all:) |
0c2d7aa
to
8199c4a
Compare
8199c4a
to
31f84ae
Compare
@ukutaht I've added test & documentation and believe that this is ready for review. |
@salomvary build failed with a linting error. The check can be disabled for the function like so: analytics/lib/plausible/billing/plans.ex Line 40 in f2a8809
|
@ukutaht Pushed the fix to the linting error. |
Just wanted to chime in here that this functionality would be immensely helpful for us as well. We've got a similar use case as @salomvary, i.e. a rudimentary banner system using Plausible events to track impressions/clicks. We'd use this API functionality to create graphs to show impressions/clicks for each day. Thank you @salomvary for working on this! :) |
Thank you! |
Seems like this is live already \o/ Thanks for open-sourcing Plausible, it's been a pleasure contributing :) |
This is a followup of the question I asked in #3495.
Meanwhile, we also contacted support via email, to which the answer was:
Which, well, confirms that it is not possible to get a timeseries of custom events, but does not explain the reason.
I poked around in the codebase and it seems to be possible to get timeseries of custom events with minimal changes. Note that these are my first two lines in Elixir and I have no idea what I am doing :)
I did some manual testing with a locally running Plausible, and this had the expected outcome. If these changes are deemed acceptable, I'm happy to figure out how to add tests, documentation & co.
I've tested this locally withe the following:
Tests
Changelog
Documentation
Dark mode