simpleanalytics / roadmap

File you bugs and feature requests here
24 stars 2 forks source link

Add meta data to dates on graphs #486

Open simpleanalyticsbot opened 3 years ago

simpleanalyticsbot commented 3 years ago

I want to be able to add some kind of metadata to overlay onto the graphs. This way, one could plot events that could explain/give context to trends or freak events.

Here’s an illustration of what it would be like:

Let’s say my website gets featured on hacker news or some other special event like a new release or a DDOS attack, it would be great to get that context when looking at the stats later on. So that looking at a graph, freak events would not just look like freak events: this one would be the day we were “featured in that NYT article” and that dip right there would be when we lost 7 hours of statistics because we “forgot to include the analytics script after implementing new design”.

Here’s how it could be implemented:

Clicking anywhere on a graph would bring a simple dialog where I could add a few words to that specific date. The data would then be displayed on top of any graph that includes that date. This could be displayed as its own (toggle-able) layer or it could just be added to the detailed stats overlay with some kind of visual hint that there is meta data logged for that date.

From issue https://github.com/simpleanalytics/roadmap/issues/523

I'd like to annotate the visitor graphs with events. For example if there is a huge spike in Facebook traffic, I might annotate it with when a Facebook ad campaign went live.

adriaandotcom commented 3 years ago

I think this is your issue, right @tomax? So basically you want to annotations that we have for certain events (for example the one you see on our open page – the second last chart)?

tomax commented 3 years ago

It is. Not sure what you open page is though 😅 But yeah, annotations on specific dates to explain the data.

adriaandotcom commented 3 years ago

Sorry, I forgot to link to it: https://simpleanalytics.com/open

Screenshot

tomax commented 3 years ago

Yes, something like that 👌

equivalentideas commented 3 years ago

This would be really helpful for things like, "CEO featured on podcast", or "Advertised in x newspaper today" etc. .

higgins commented 3 years ago

Happily using the product for over a year now and I too would LOOOOOVE this feature.

Fraze commented 3 years ago

I also love this! I saw the Simple Analytics Open page and realized it would be an incredible feature since my websites have a lot of spikes like this which I wish to be able to explain.

Even if someone just has a workaround for how to make this work, I'd be interested.

Fraze commented 3 years ago

Update on attempting a hackable way to do this. It looks like the graph is using: https://www.chartjs.org/chartjs-plugin-annotation/guide/types/line.html#configuration

Copy and paste this into the options box to see it work: const options = { plugins: { autocolors: false, annotation: { annotations: { line1: { type: 'line', //yMin: 60, //yMax: 60, xMin: 'March', xMax: 'March', borderColor: 'rgb(255, 99, 132)', borderWidth: 2, label:{ //backgroundColor:"#C9D1D8", cornerRadius:3, fontFamily:"Kohinoor Bangla, Arial, sans-serif", fontStyle:"normal", fontSize:10, content:"start of unique visits", enabled:true, display:true, value: 'March', link:'https://docs.simpleanalytics.com/uniques', }, } } } } }; image