-
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-react-helmet] and [gatsby-plugin-google-analytics] don't play well with Title changes #2478
Comments
Yeah that makes sense! Perhaps we just wrap the GA update in a setTimeout to let react helmet finish before running? How's that sound? Want to put together a PR? |
I haven't dug too deeply into this but using nfl's react metrics might be an option |
@KyleAMathews Would also be interested in a solution. So you propose to set a timeout here? |
@LekoArts yeah exactly. Just set a timeout of 0 and that should be enough to make GA wait for the title update to finish. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues as many of them have already been resolved with the latest updates or explained in a previous issue. Feel free to open a new one if you still experience this problem or a similar one! 👍 |
…byjs#10917) There is still a problem with title and path not being correct while navigating across a page. As referenced in: gatsbyjs#9139 Solution made in: gatsbyjs#2478 and gatsbyjs#3362 For some reason the previous solution is being overwritten Co-authored-by: Ward Peeters <ward@coding-tech.com>
When using React Helmet and the Google Analytics plugin together, it seems that the route change handler causing GA to fire occurs before React Helmet has a chance to update the
<title>
. This results in GA data often having the previous page title for any given URL.This can be seen in the existing gatsbyjs.org site by navigating to the homepage, then to the "Community" page, and back and forth. The Community page has a different title than the other pages, and if you check the Network tab for the GA tracker you can see that the title is always the previous page.
The text was updated successfully, but these errors were encountered: