You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While @analytics/google-tag-manager should add only gtm.js script, I see in my HTML also gtag.
I'm not sure it's a part of the package, since I wasn't able to find any evidence in the source code of the library, but I am curious, why gtm adds gtag as well. Due to this fact, the performance of the page is affected.
The text was updated successfully, but these errors were encountered:
Does gtm.js add gtag/js automatically? (Looks like it is "yes", since gtm.js contains the G-xxxxxx key inside
Is this behavior intentional? I read a lot that we do not need both tags, and they claim it's bad to add both
Is there a way to have a certain setting in @analytics/google-tag-manager to manage the behavior?
I bet @analytics/google-tag-manager needs a Readme about this behavior.
Because, it looks like @analytics/google-tag-manager also behaves like @analytics/google-analytics (which v4)
import Analytics from 'analytics'
import googleAnalyticsPlugin from '@analytics/google-analytics'
import googleAnalyticsV3Plugin from '@analytics/google-analytics-v3'
/* Initialize analytics instance */
const analytics = Analytics({
app: 'my-app',
plugins: [
/* Load Google Analytics v4 */
googleAnalyticsPlugin({
measurementIds: ['G-abc123'], // this is the `G-xxxxx` key i have in my setup
}),
],
})
analytics.page()
Carduelis
changed the title
@analytics/google-tag-manager adds gtag.js as well@analytics/google-tag-manager adds gtag.js to gtm.js as well
Feb 9, 2023
Carduelis
changed the title
@analytics/google-tag-manager adds gtag.js to gtm.js as well@analytics/google-tag-manager adds gtag to gtm.js as well
Feb 9, 2023
While
@analytics/google-tag-manager
should add onlygtm.js
script, I see in my HTML alsogtag
.I'm not sure it's a part of the package, since I wasn't able to find any evidence in the source code of the library, but I am curious, why
gtm
addsgtag
as well. Due to this fact, the performance of the page is affected.The text was updated successfully, but these errors were encountered: