OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
97 stars 19 forks source link

Better Google Analytics Integration #940

Open lentinj opened 1 month ago

lentinj commented 1 month ago

There's a laundry list of problems with Google Analytics:

Ultimately what we want to do is improve the average engagement time:

(The total length of time your website was in focus or your app was in the foreground across all sessions)
    /
(The total number of active users)

...given this is total session time, even if users ended up with multiple tiny sessions that shouldn't be a problem. Possibly the lack of Enhanced Measurement means we can't measure session time?

lentinj commented 1 month ago

I've added onezoom.org & www.onezoom.org to list of domains:

https://analytics.google.com/analytics/web/#/a35612933p275165219/admin/streams/table/2644191729

...I'm not convinced it's necessary, but was recommended by the config pages and I don't think it'll hurt.

hyanwong commented 1 month ago

Great, thanks @lentinj

lentinj commented 3 weeks ago

Having pondered this over the weekend, these pages demystify what's going on a bit:

Basically, engagement time is reliant on events sending "engagement_time_msec" (which is kinda obvious in retrospect). We've not enabled "enhanced measurement", which means the additional events aren't happening.

Our new events do send "engagement_time_msec" so I think we should see a dramatic improvement. The remaining questions are:

  1. Do we want to enable enhanced measurement? For the tree it's largely useless, for regular pages they could be interesting, but there's enough page views happening as you click on links that I don't think we'd learn too much more. The main thing is to keep history API instrumentation off, which will spam page_view events as you scroll around the tree.
  2. Should we send a "scroll" event on record_url()? Without, a user who opens the tree viewer, zooms around a bit and closes won't have their full session time recorded.

For (1), I feel like being as close to the default settings as possible is most useful, to make one less thing to remember.

For (2), I can't find any evidence of limits we'd exceed, but it feels excessively chatty to me. I'd rather wait & see if it's needed instead of leaping straight in.

lentinj commented 2 weeks ago

Things we want to get done ~now:

lentinj commented 2 weeks ago

I think this is all done now, the weirdest addition is "popup_scroll" which fires if a wikipedia page has scrolled, and is still visible after 5 seconds after the event. It doesn't fire for subsequent scrolls.

The main point was to lessen false-positives, flicking and immediately closing. We could fine-tune it if need be.