snowplow / iglu-central

Contains all JSON Schemas, Avros and Thrifts for Iglu Central
http://iglucentral.com
Apache License 2.0
118 stars 114 forks source link

Add schemas for screen engagement tracking on mobile #1358

Closed matus-tomlein closed 9 months ago

matus-tomlein commented 11 months ago

This PR adds 3 schemas for screen engagement tracking on mobile (screen_time and screen_end) and both on mobile and Web (view_segment).

These schema support the proposal presented in this demo.

matus-tomlein commented 11 months ago

As I was implementing this in the iOS tracker, I iterated a bit on the schemas. I recorded a short video to demo how the schemas will be used in tracking, it can be found here.

Overall the changes are:

  1. Renamed the vendor for all schemas to com.snowplowanalytics.mobile. All of these schemas are for mobile trackers and this is also the vendor used for the screen view event which they are used with.
  2. In the screen_summary entity schema, I renamed the list item properties to be: last_item_index and items_count. So they will contain the index of the last viewed item and the number of all items in the list.
  3. I added a third event schema for list_item_view event. If screen engagement is enabled on mobile, this event will be aggregated into the screen_summary context entity. It is just used as a way for users to update the currently seen list items.
matus-tomlein commented 10 months ago

Final update: after some discussion, we also added scroll view tracking in pixels (in addition to the list view tracking). We can't provide automatic tracking for this, but users can listen for scroll changed events in their scroll views and track a scroll_changed event. This is handled the same as the list_item_view event and aggregated in the screen_summary entity – there are two new properties: max_y_offset and content_height.

rlh1994 commented 10 months ago

there are two new properties: max_y_offset and content_height

Can mobile applications have an x offset and width greater than the screen?

matus-tomlein commented 10 months ago

It'd be quite rare, but actually why not add it since we also have the horizontal scroll depth on Web too... Have updated the schemas to make it possible to track too.

matus-tomlein commented 10 months ago

One more update: have also added min_x_offset and min_y_offset to match with scroll depth tracking on the Web.

matus-tomlein commented 9 months ago

Cherry picked to R152