-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
fix(v2): GTM, send page_view events on navigate #3243
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 29b622a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
LGTM, but prettier failure
@govardhan-srinivas I don't know gtag unfortunately and don't even have an account. What do you feel is the right solution, and have you actually tested it live on a real Docusaurus site and GTM account to ensure it works? Also if you hesitate between solutions, please help me help you by linking to the relevant parts of the docs |
@slorber I was refering this link, I find 2 ways of capturing pageviews:
Both does the same functionality but I feel second one has more advantage over the first, As we can set manual break points when to trigger the page view event. If we agree on above thing, we can merge this PR. |
Thanks, this solution looks fine |
Closes #3047
Motivation
Was following Facebook open-source immersion program, recently did my PR to the Material UI repo, So thought to give a try.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Followed the Google Analytics document while implementing pageviews.
Demo site with this change: https://govardhan-srinivas.github.io/docusaurus-blog-mode/
Screenshot of pageviews in google analytics
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)