The Google Tag (gtag.js) Explained: How to Install It and Track Conversions

What the Google tag is, how to install it, and how to use it to track conversions in Google Ads.

Every Google Ads campaign depends on one thing working behind the scenes: tracking. If Google can't see which clicks turned into purchases, leads, or sign-ups, it can't tell you what's working, and smart bidding has nothing to learn from. For most websites, that tracking starts with the Google tag.

This guide explains what the Google tag is, how to install it, how it tracks conversions, and how to check that it's working.

What Is the Google Tag?

The Google tag, also called gtag.js, is a small piece of code you add to every page of your website. It lets your site send information to Google products like Google Ads and Google Analytics. You may have heard it called the "global site tag," which was its older name.

On its own, the Google tag records visits and builds remarketing audiences. To track conversions, you pair it with a conversion event, which tells Google that something valuable just happened, like an order or a form submission.

The Two Parts of Conversion Tracking

  • The Google tag: the base code that loads on every page. It identifies your Google Ads account with a tag ID that starts with "AW-".
  • The conversion event: a small extra snippet that fires only when a conversion happens, such as on an order confirmation page or after a form is submitted. It includes a conversion label that tells Google which conversion action to count.

A typical conversion event looks like this:

gtag('event', 'conversion', { 'send_to': 'AW-123456789/AbC-D_efG', 'value': 49.99, 'currency': 'USD', 'transaction_id': 'ORDER-1042' });

The send_to value identifies your account and conversion action. Value and currency let you track revenue. The transaction ID helps prevent the same order from being counted twice if someone reloads the page.

Ways to Install the Google Tag

  • Directly in your website code: paste the tag into the head section of every page. Most website builders have a spot for site-wide header code.
  • Through your platform's integration: many ecommerce and website platforms connect to Google directly and install the tag for you once you link your account.
  • Through Google Tag Manager: instead of adding code to your site, you install Tag Manager once and manage your Google tag and conversion tags inside it. This is the most flexible option if you track several actions or use several marketing tools.

Pick one method. Installing the same tag in more than one way is a common cause of double-counted conversions.

How to Set Up a Conversion With the Google Tag

  1. In Google Ads, go to Goals, then Conversions, and create a new conversion action for your website.
  2. Choose what you're tracking, such as a purchase, lead form, or sign-up, and set its value and counting option.
  3. Install the Google tag on every page if it isn't already there.
  4. Add the conversion event so it fires when the action happens: on the confirmation page, or when the form is successfully submitted.
  5. Test it, then check Google Ads over the next day or two to confirm the conversion action shows as recording conversions.

Count "One" or "Every"?

  • Every: best for purchases. If someone buys twice, you want both sales counted.
  • One: best for leads. If someone submits your contact form three times, it's still one lead.

Enhanced Conversions

Enhanced conversions add first-party information, like an email address from a form or checkout, to your conversion tracking. That information is hashed before it's sent to Google and helps match conversions that might otherwise be missed. You can turn it on in your conversion settings and configure it through the Google tag or Google Tag Manager.

Consent and Privacy

If you have visitors in regions with consent requirements, like the European Economic Area or the UK, your site needs a consent banner and consent mode set up so the Google tag respects each visitor's choice. Even outside those regions, make sure your privacy policy explains how you use tracking.

How to Test Your Google Tag

  • Use Google Tag Assistant to load your site and confirm the Google tag fires on every page.
  • Complete a test conversion, like a form submission or a test order, and confirm the conversion event fires once.
  • In Google Ads, check the status column for your conversion action. It should change to recording conversions after real conversions come in.

Common Mistakes

  • Firing the conversion event on page load of the form page instead of after a successful submission.
  • Installing the tag twice, once in the site code and again in Tag Manager.
  • Leaving out the transaction ID on purchases, so page reloads double-count orders.
  • Tracking button clicks instead of completed actions.
  • Setting low-value actions like page views as primary conversions, which teaches smart bidding the wrong goal.

Final Thoughts

The Google tag is the foundation of accurate Google Ads tracking. Install it once on every page, fire conversion events only when something valuable actually happens, and test everything before you rely on the data.

At Uppertier Marketing, we audit and set up conversion tracking for every account we manage, because every bidding and budget decision depends on it. If you're not confident your tracking is accurate, schedule a call with our team.

Beau Bozett
Written by

Beau Bozett

Founder

Message me on Slack

Explore more topics

Partner with our Google ads team to maximize your revenue

Schedule a call