Google Tag (gtag.js)

Google Tag (gtag.js) is a unified JavaScript tracking snippet that serves as the foundation for Google Ads conversion tracking, remarketing audience collection, and Google Analytics data collection. It replaces the older Global Site Tag and consolidates multiple tracking codes into a single implementation.

Google Tag (gtag.js) is a unified JavaScript tracking snippet that serves as the foundation for Google Ads conversion tracking, remarketing audience collection, and Google Analytics data collection. It replaces the older Global Site Tag and consolidates multiple tracking codes into a single implementation.

Key Takeaways

  • Single tag that powers conversion tracking, remarketing, and analytics across Google products
  • Installed once on every page of your website, with event-specific snippets for conversions
  • Managed through the Google Ads interface or Google Tag Manager
  • Supports Enhanced Conversions for improved measurement accuracy
  • Replaces legacy conversion tags and the older analytics.js library

What Is Google Tag

Google Tag is the current JavaScript framework Google uses for all measurement and tracking across its advertising and analytics platforms. In the 2026 Google Ads interface, it is configured under Tools > Data manager > Google tag.

ComponentPurposePlacement
Google Tag (base)Loads the tracking library, sets cookies, captures page viewsEvery page
Event snippetFires specific conversion events with values and parametersConversion pages only
Remarketing parametersPasses custom data for audience buildingProduct/category pages
Enhanced ConversionsSends hashed first-party data for better attributionConversion pages

How It Works

The Google Tag operates in two layers:

  1. Base tag — A JavaScript snippet placed in the <head> section of every page. It loads the gtag.js library and initializes your Google Ads and Analytics accounts using their measurement IDs. The base tag handles cookie management, GCLID capture, and basic page view tracking.

  2. Event tags — Additional code that fires on specific actions. For conversion tracking, an event tag on your thank-you page sends conversion data (action, value, currency, transaction ID) to Google Ads. For remarketing, event tags on product pages send item IDs and categories to build audience lists.

The tag can be deployed in three ways:

  • Direct installation — Paste the code snippet into your website HTML
  • Google Tag Manager — Deploy through GTM as a tag template (recommended for complex setups)
  • CMS integration — Native plugins for WordPress, Shopify, and other platforms

Practical Example

An e-commerce site installs the Google Tag:

  • Base tag on all pages: initializes tracking for Google Ads (AW-123456789) and GA4 (G-XXXXXXXXXX)
  • Purchase event tag on order confirmation: sends purchase event with transaction value, order ID, and item data
  • The same base tag also captures remarketing data for audience building
  • Enhanced Conversions enabled: hashed email sent with purchase events

Before the Google Tag, this required three separate code installations. Now one base tag and one event configuration handle all three functions.

Why It Matters

The Google Tag is the technical foundation for all Google Ads measurement. Without it, conversion tracking does not function, remarketing audiences cannot be built, and automated bidding strategies lose the signal data they need to optimize. A properly configured Google Tag is the difference between data-driven campaign management and guessing. Misconfiguration — missing tags, duplicate firing, or incorrect event parameters — is one of the most common causes of inaccurate conversion data in Google Ads accounts.

Try Lyra Free

19 Google Ads optimization tools. 14-day free trial.

Start Free Trial

No credit card charged until trial ends