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

Set exit_page only on pageviews #3870

Merged
merged 5 commits into from
Mar 18, 2024
Merged

Set exit_page only on pageviews #3870

merged 5 commits into from
Mar 18, 2024

Conversation

macobo
Copy link
Contributor

@macobo macobo commented Mar 7, 2024

Changes

Previously we set and updated exit_page on all events, which can cause issues when:

  1. Sessions without any pageviews are made (e.g. user leaves a tab open and returns to it)
  2. It results in exit_page exit_rate calculations returning numbers above 100

Additional context under https://3.basecamp.com/5308029/buckets/35611491/card_tables/cards/7162713530

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

@macobo macobo requested a review from a team March 7, 2024 15:11
@zoldar
Copy link
Contributor

zoldar commented Mar 7, 2024

The change makes sense to me, but it seems to also require updating how we query for stats so that we filter out custom events-only sessions from breakdowns/aggregates in which they do not apply. That might have some wider implications too, but I'm not familiar enough with that aspect to tell for sure 😅 Probably best if @ukutaht has a closer look at this too.

Copy link
Member

@aerosol aerosol left a comment

Choose a reason for hiding this comment

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

Would be good to look into those test failures. Can't quickly tell if it's a fixture error, a regression or if there's something easily abused with the way we populate test data.

@macobo
Copy link
Contributor Author

macobo commented Mar 8, 2024

Test failures were real - we were creating Signup events in the relevant tests.

Given that this also affects bounce rates, etc as per these example tests, it would be great to have @ukutaht's input before merging this.

but it seems to also require updating how we query for stats so that we filter out custom events-only sessions from breakdowns/aggregates in which they do not apply

@zoldar I'm considering that a separate task that's slightly trickier than this given the wide-reaching ramifications. I was planning to make sure this gets a satisfying solution, but is less urgent than this fix. If you have input/thoughts or want to lead that feel free! 🙇

@zoldar zoldar mentioned this pull request Mar 11, 2024
4 tasks

session = get_session(site_id)

assert session.exit_page == "/path/2"
Copy link
Contributor

Choose a reason for hiding this comment

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

For extra clarity I think this test could also assert that session.entry_page == ""

Copy link
Contributor Author

@macobo macobo Mar 14, 2024

Choose a reason for hiding this comment

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

This brings up a question: Should we also update entry_page on a subsequent event if a) it's a pageview and b) session doesn't have entry_page set?

After re-visiting I think we should set exit_page to /path/2 here as well, thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

After re-visiting I think we should set exit_page to /path/2 here as well, thoughts?

you mean entry_page rather than exit_page, right?

Yeah I think that does make sense. Then entry page and exit page will always correspond to the first and last pageview in a session which feels intuitive to me.

@ukutaht
Copy link
Contributor

ukutaht commented Mar 14, 2024

Wait, I approved too early. Why does this affect bounce rates? 👀

@ukutaht
Copy link
Contributor

ukutaht commented Mar 14, 2024

As per discsussion, this solution is good. Let's do it!

@macobo macobo merged commit 02d2256 into master Mar 18, 2024
8 checks passed
@macobo macobo deleted the exit-page-counting branch March 18, 2024 09:11
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.

4 participants