Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding <GoogleTagManager> component to @next/third-parties #56106
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
Adding <GoogleTagManager> component to @next/third-parties #56106
Changes from 7 commits
733a173
022a773
21551de
d6d7944
2a74723
52ca4e2
ee5969f
63ddaf7
fee976a
07a8f15
ff6b24f
e8dd1cc
33db325
8f143c8
ed30df7
7f9cf1c
e5473fc
5785971
9c2fd1f
49e29a6
3c9fc3f
f84dcae
ae0463b
4b6b00c
86d1a29
1e3031d
0fe8864
0a3c63b
fbd24de
fa14ece
0ecadb9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@janicklas-ralph Do you know if the bundle is being tree-shaken with this approach? For example, I import
useGoogleTagManager
in my app, isGoogleMapsEmbed
andYouTubeEmbed
included into the total bundle even if they're not used?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.
We can do this in a separate PR, but we should update the GTM example in the
examples/
repo to show this newer approachThere 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.
Is the double
<GoogleTagManager gtmId="GTM-XYZ" />
on line 13 and 18 an oversight? Same intest/e2e/third-parties/pages/gtm.js
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.
I had thought the same in the beginning, but I recall @janicklas-ralph mentioning that it is was deliberate to test that the behavior if an identical GTM containers is included by accident
@janicklas-ralph Can you clarify, and if so, add a note here in a future PR? (not urgent)