-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
gatsby-plugin-google-analytics: sendPageView
should be called via requestAnimationFrame
, when available
#28591
Comments
We'd be happy to receive a PR to fix this. Thanks for the issue! |
@LekoArts: Sorry, I'm not using Google Analytics myself, and I'm behind with my own projects, so I won't create a PR myself (researching and reporting this bug used up all my available time for this). |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Looks like nobody is interested in fixing this, but this issue is still about a bug that should get fixed at some point, so it should be kept open, IMO. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Hi, is this still an issue? I am experiencing incorrect (unset) title names on google analytics. If so, I can do the PR. |
React-Helm uses requestAnimationFrame to avoid FOUC.
This lead to a bug in
gatsby-plugin-google-analytics
where a page view was sent with the title of the previous page.A workaround was implemented to fix the problem:
For some reason,
requestAnimationFrame
was removed later (see here):Basically, this code assumes that every display has a refresh rate of 60, which is not the case (the iPad Pro has a refresh rate of 120, for example).
Because React-Helm uses
requestAnimationFrame
when available (and this plugin does not), this means, that on devices with a higher refresh rate than 60, the wrong title still could be sent.See MDN on requestAnimationFrame:
An easy fix would be, to restore the original implementation (see above)
The text was updated successfully, but these errors were encountered: