DavidWells / DavidWells/analytics
`@analytics/google-tag-manager` adds `gtag` to `gtm.js` as well
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
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.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported HTML output with @analytics/google-tag-manager and inspect the package source for where gtm.js and gtag are added. Compare the generated scripts with the issue's expectation that only gtm.js is present. Done means the source of the extra gtag script is identified and the package behavior is corrected or clearly explained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- analytics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100