DavidWells / DavidWells/analytics

`@analytics/google-tag-manager` adds `gtag` to `gtm.js` as well

Open
#359 2 comments 0 reactions 0 assignees View on GitHub

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.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.