`@analytics/google-tag-manager` adds `gtag` to `gtm.js` as well
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.

To make it clearer, I have a couple of questions:
- Does
gtm.jsaddgtag/jsautomatically? (Looks like it is "yes", since gtm.js contains theG-xxxxxxkey 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-managerto manage the behavior? - I bet
@analytics/google-tag-managerneeds 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()
GTM only adds one script tag here https://github.com/DavidWells/analytics/blob/master/packages/analytics-plugin-google-tag-manager/src/browser.js#L66
It sounds like your google tag script is added the additional script. Check your container ID and verify what it's loading