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.jsor 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.
Related work
For the Google consent layer, see the consent debugging guide. For a web-container route, see install a GTM container.
Official references
- Google Tag Manager vs. gtag.js Checked November 10, 2026
- Introduction to tagging and the Google tag Checked November 10, 2026
- Set up the Google tag with gtag.js Checked November 10, 2026
What changed
- v1.0.0Initial bilingual guide drafted and verified against linked official Google documentation.