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 scroll tracking to finders #3120

Merged
merged 1 commit into from
Jul 27, 2023
Merged

Conversation

andysellick
Copy link
Contributor

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Adds scroll tracking to finders, e.g. /search/all. Should work for all finders, check the page at / for a full list to test.

  • adds scroll tracking module to the base template for all finders
  • uses the default scroll track mode of tracking percentage scrolled, every 20%

NOTE this PR depends upon the scroll tracking code in static, it's currently only on integration.

Why

Part of the GA4 migration

Visual changes

None.

Trello card: https://trello.com/c/r75BqxiW/608-scroll-tracking-percent-type-finders

- adds scroll tracking module to the base template for all finders
- uses the default scroll track mode of tracking percentage scrolled, every 20%
@govuk-ci govuk-ci temporarily deployed to finder-frontend-pr-3120 July 26, 2023 07:12 Inactive
@andysellick andysellick requested a review from AshGDS July 26, 2023 13:53
@andysellick andysellick changed the title Add scroll tracking to finders [DO NOT MERGE] Add scroll tracking to finders Jul 26, 2023
Copy link
Contributor

@AshGDS AshGDS left a comment

Choose a reason for hiding this comment

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

@andysellick Looks good, but I've noticed that I can't get the 100% scrolled event to activate - is that expected?

@AshGDS
Copy link
Contributor

AshGDS commented Jul 26, 2023

@andysellick I think Math.max might be the problem, when I minus one from the end of it, it seems to fix it:

var pageHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight) - 1

@andysellick andysellick changed the title [DO NOT MERGE] Add scroll tracking to finders Add scroll tracking to finders Jul 27, 2023
@andysellick andysellick merged commit d543e69 into main Jul 27, 2023
8 checks passed
@andysellick andysellick deleted the add-scroll-tracking-to-finders branch July 27, 2023 15:44
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