The Google Tag Evolution

Historically, Google Analytics (Universal Analytics) used an UA- tag and Google Ads used AW- tags, each with their own separate implementation. With the advent of Google Analytics 4 (GA4) and the overall push for a more unified tracking experience, Google introduced the Google tag (gtag.js).

The Google tag is a single piece of code that you can add to your website to send data to various Google products, including Google Analytics 4 and Google Ads. This means you no longer necessarily need separate tags for each product on your website.

Key takeaway: While you might still see G- and AW- prefixes, they now often refer to different destination IDs within a single Google tag implementation.

G- Tag (Google Analytics 4)

  • Prefix: G- (e.g., G-XXXXXXXXX)
  • What it represents: This is your Measurement ID for a Google Analytics 4 property. It identifies your specific GA4 property where you want to send website data for analytics purposes.
  • Purpose:
    • Website Analytics: Primarily used to collect data about user behavior on your website (page views, clicks, scrolls, sessions, demographics, etc.).
    • Understanding User Journeys: Helps you analyze how users interact with your site, identify popular content, and understand conversion paths.
    • Audience Building: Allows you to create audiences based on user behavior for remarketing in Google Ads or personalization on your site.
  • Where to use it:
    • Directly in your website’s HTML: You place the Google tag snippet, including your G- ID, within the <head> section of every page you want to track.
    • Via Google Tag Manager (Recommended): This is the most flexible and recommended method. You create a “Google Tag” in Google Tag Manager (GTM) and input your G- Measurement ID. GTM then injects the necessary code onto your website. This allows you to manage all your tags (Google and third-party) from one interface without directly editing website code.

AW- Tag (Google Ads)

  • Prefix: AW- (e.g., AW-XXXXXXXXX)
  • What it represents: This is your Conversion ID for a Google Ads account. It identifies your specific Google Ads account for conversion tracking and remarketing purposes.
  • Purpose:
    • Conversion Tracking: Tracks specific actions on your website that you’ve defined as valuable conversions for your Google Ads campaigns (e.g., purchases, form submissions, phone calls, sign-ups). This helps you measure the effectiveness of your ads.
    • Remarketing: Builds audiences of users who have visited your website (or specific pages) so you can show them targeted ads later.
  • Where to use it:
    • Directly on your website’s HTML: Similar to the G- tag, you would place the Google tag snippet (with your AW- ID) on your website. For specific conversions, you’d also include an “event snippet” on the conversion page.
    • Via Google Tag Manager (Recommended): You create a “Google Tag” in GTM and add your AW- ID as a destination. You would then configure “Google Ads Conversion Tracking” or “Google Ads Remarketing” tags in GTM, which fire when specific events (your conversions) occur.

How they work together (and why you might see both)

With the unified “Google tag,” you can often use a single gtag.js snippet on your website and configure it to send data to both your G- (GA4) and AW- (Google Ads) destinations.

For example, your base Google tag code might look something like this:

HTML

<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXXXXXX'); // Your Google Analytics 4 Measurement ID
  gtag('config', 'AW-YYYYYYYYY'); // Your Google Ads Conversion ID
</script>

In this scenario, the G- ID might be the primary ID in the initial src of the tag, but the gtag('config', 'AW-YYYYYYYYY'); line tells the same tag to also send data to your Google Ads account.

If you are using Google Tag Manager, you would create a single “Google Tag” and then add both your G- and AW- IDs as “destinations” within that tag’s settings. You would then create specific event tags (e.g., “Google Ads Conversion”) within GTM that fire when a conversion occurs, using the AW- destination.

In summary:

  • G- tag: Primarily for Google Analytics 4 to collect comprehensive website data and understand user behavior.
  • AW- tag: Primarily for Google Ads to track conversions and build remarketing audiences for your ad campaigns.
  • The “Google Tag” (gtag.js): The modern, unified approach that can send data to both GA4 and Google Ads (and other Google products) using a single base code snippet and by defining multiple “destination IDs” (like your G- and AW- IDs).
  • Google Tag Manager (GTM): The highly recommended way to manage all these tags and events in a flexible, code-free environment.

The best practice is to use Google Tag Manager to deploy and manage both, ensuring they work together efficiently and accurately.