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

Add schemas for screen engagement tracking on mobile #1358

Closed
wants to merge 4 commits into from

Conversation

matus-tomlein
Copy link
Contributor

@matus-tomlein matus-tomlein commented Nov 25, 2023

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.

  • com.snowplowanalytics.snowplow/screen_summary/jsonschema/1-0-0
    • schema for entity tracked with mobile events (foreground/background/scren_end) with duration of the screen in foreground and background
  • com.snowplowanalytics.snowplow/screen_end/jsonschema/1-0-0
    • schema for event tracked before transitioning to the next screen on mobile. it doesn't have any properties but will be tracked with the screen_time and view_segment entities

Copy link

@rlh1994 rlh1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few Qs

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last question, do we have any other events that have no properties (that's aren't the page ping). Just wondering how this will work with the loader in terms of creating a column... @jbeemster ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have a few events like that – the application_install event is quite a common one for example. Checking our dev1 Snowflake atomic events, I don't see a column for it, so probably the column is not created if the event schema has no properties?

@matus-tomlein
Copy link
Contributor Author

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.

Copy link

@rlh1994 rlh1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few questions because I don't develop mobile apps so don't really know what this means

@matus-tomlein matus-tomlein force-pushed the issue/screen_engagement branch 2 times, most recently from 4b07581 to 4a49796 Compare December 12, 2023 10:17
@matus-tomlein
Copy link
Contributor Author

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.

@matus-tomlein matus-tomlein changed the title Add schemas for screen engagement tracking on mobile and Web Add schemas for screen engagement tracking on mobile Dec 12, 2023
@rlh1994
Copy link

rlh1994 commented Dec 12, 2023

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Copy link

@rlh1994 rlh1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@mscwilson mscwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matus-tomlein
Copy link
Contributor Author

Cherry picked to R152

@matus-tomlein matus-tomlein mentioned this pull request Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants