SaTracking
ConsentNEWBeginner

Choose Google Tag Manager, gtag.js, or Firebase

Select a Google tagging approach based on whether you measure a website or app and who must manage tags.

Download for AI (.txt)

Want to check this in your browser? Run the local audit.

Measurement topic illustration · SaTracking

Audience and prerequisites

Compare GTM, gtag.js and Firebase on who edits the code, how consent and releases are controlled, and what each choice costs to maintain. List the products to measure, the platform (website, Android/iOS app, or both), who can change source code, and who will review tag changes. Skill level: beginner. Reading time: seven minutes.

1. Choose by platform first

For a mobile app, Google's Tag Platform directs app measurement to the Google Analytics for Firebase SDK; Tag Manager can be used to manage supported app tags. A web implementation uses the Google tag (gtag.js) or a web GTM container. Do not paste a web snippet into a native app.

2. Choose how much control the team needs

  • Google tag (`gtag.js`) fits a simpler direct website setup where developers manage the tag in the site's code and send supported Google product commands there.
  • Google Tag Manager (GTM) provides a web interface for managing supported tags, triggers, variables, permissions, and versions. It can fit a team that needs centralized tag changes and review without editing site code for every tag change. The container still needs a correct, maintained installation and governance.
  • Firebase SDK is the app measurement route for Android and iOS. It is not a replacement name for the website's gtag.js or web container.

Use Google's current setup-planning guide to assess the CMS, existing integrations, required destinations, and team workflow. If the site platform already provides a Google integration, inspect it before adding another tag. Two installation paths can cause duplicate pageviews or events.

3. Write down the ownership model

Record who owns the source code or GTM container, who approves changes, and how test and production properties are separated. Decide where event names and parameters are defined and how each implementation is validated. A tool choice does not define a measurement plan or consent policy for you.

4. Verify the chosen path

For gtag.js, follow Google's installation order and test the configured destination with Tag Assistant. For web GTM, install one container, configure tags and triggers in a workspace, then use Preview before publishing. For Firebase, follow the relevant platform SDK setup and validate app events using the app-specific tooling. Do not judge success solely from a script being present.

Common errors and privacy

Avoid adding gtag.js on top of a GTM installation that already sends the same events. Avoid using a web data-layer sample as Firebase app code. Before implementation, identify consent behavior, data minimization rules, and the owners who will maintain them. Follow the Google consent guide for Google-tag consent behavior and separate controls for non-Google vendors.

For the Google consent layer, see the consent debugging guide. For a web-container route, see install a GTM container.

Official references

EDITORIAL HISTORY

What changed

  1. v1.0.0
    Initial bilingual guide drafted and verified against linked official Google documentation.
MEASUREMENT SUPPORT

Need a hand with your tracking?

Nicolas Salazar works with teams on analytics, tracking plans, data quality, consent, and implementation.