Questions tagged [gtag.js]

The Global Site Tag (gtag.js) provides a framework for streamlined web page tagging – giving you better control while making implementation easier. Using gtag.js lets you benefit from the latest tracking features and integrations as they become available.

322 questions
36
votes
4 answers

gtag function Typescript definition

I use original Javascript function function gtag(){dataLayer.push(arguments);} then got error: error TS2554: Expected 0 arguments, but got 3. when used like this: gtag('event', 'page_view', { send_to: 'xxxx' }) I used // @ts-ignore as a…
Sobik
  • 632
  • 3
  • 8
  • 14
33
votes
4 answers

Google Analytics Gtag Multiple Analytics Account Tracking IDs

From what I can see Google seem to be phasing out analytics.js now in favor of their tag manager. How do I fire google analytics new gtag tracking code for multiple analytics accounts? Something like this: