How to Add Google Ads Tracking Code in WordPress?

Alexandre Airvault
January 19, 2026

Understand What “Google Ads Tracking Code” Actually Means on WordPress

When most advertisers say “Google Ads tracking code,” they’re usually referring to two pieces that work together: the sitewide Google tag (gtag.js) and a conversion event snippet that fires when a specific action happens (like a purchase, lead, or sign-up). The sitewide tag should appear across your entire WordPress site (typically in the <head>), while the event snippet is added only where the conversion should be recorded (often your “thank you” or order confirmation page).

One key platform change that still trips people up is naming: what used to be called the “global site tag” is now simply the Google tag. If you already have an older gtag.js implementation on your site, you generally don’t need to replace it just because the label changed; you focus instead on ensuring the right destinations and events are configured.

Also note the tag ID prefixes you’ll see inside the Google tag setup. A tag ID that starts with AW- is typically associated with Google Ads measurement, while a tag ID that starts with G- is typically associated with Google Analytics. Either can support strong Google Ads measurement, but your setup path will differ depending on whether you’re tracking conversions directly in Google Ads (common for lead gen) or importing conversions from Analytics (common when your Analytics event taxonomy is already mature).

Step 1: Generate the Correct Google Ads Conversion Tracking Code

Create (or confirm) your conversion action first

Before you touch WordPress, make sure Google Ads is actually expecting the right conversion. In your Google Ads account, create a web conversion action that matches your real business outcome (for example, “Purchase,” “Qualified lead,” or “Submit form”). This matters because your campaigns—and especially Smart Bidding—only get smarter when you feed them the right signals.

At the end of the conversion setup flow, you’ll be given instructions to implement measurement using either the Google tag directly or Google Tag Manager. If you choose direct installation, you’ll see (1) the Google tag (sitewide) and (2) an event snippet (conversion-specific). If you prefer a simpler setup and your conversions can be tied to a URL (like /thank-you), you may be able to create a URL-based (codeless) event that your Google tag can detect without you adding a separate event snippet on-page.

Decide whether you need “codeless” URL tracking or a true event snippet

URL-based conversion creation is fastest when the conversion is reliably represented by a unique page load (a dedicated confirmation URL that only appears after the action). If you need to track button clicks, dynamic checkout steps, variable revenue, transaction IDs, or anything more custom, you’ll usually want the manual event snippet approach (or Tag Manager), because it gives you precise control over when the conversion fires and what values are passed.

Step 2: Add the Google Tag to WordPress (Best Options, From Most Stable to Most Fragile)

Option A (recommended for most site owners): Install via the Site Kit plugin

If you want a clean, durable setup without editing theme files, a strong approach is using the official Site Kit plugin. Practically, this reduces the risk of your tag disappearing during theme changes and makes it easier for non-developers to manage measurement.

In a typical setup, you’ll install and activate the plugin, complete the plugin’s setup flow, then connect the service you’re measuring. If your tag ID starts with AW-, you’ll usually connect Google Ads and provide your Google tag ID to complete setup. If your tag ID starts with G-, you’ll typically connect Google Analytics by choosing the correct existing property, and then you can link/import conversions into Google Ads as needed (depending on how you want to structure reporting and optimization).

Option B: Install via a WordPress measurement plugin that integrates Analytics and tagging

If your organization already relies on a WordPress analytics plugin for governance, access control, or reporting workflows, you may choose a plugin-based install that first connects Analytics and then supports adding an Ads-oriented tag ID (AW-). This can work well when the business wants a “one dashboard” approach inside WordPress for measurement configuration.

The tradeoff is that you must be disciplined about avoiding duplicate installs (for example, the same Google tag installed by both the plugin and your theme, or by both the plugin and Tag Manager). Duplicate tagging is one of the most common causes of inflated conversions and confusing “it says it’s tracking, but numbers don’t make sense” problems.

Option C: Install manually using the WordPress Theme File Editor (fast, but easiest to break later)

If you can’t (or don’t want to) use plugins, you can paste the Google tag snippet into your theme’s header file so it loads sitewide. The standard approach is to place the Google tag snippet in the <head> section so it loads early and consistently.

In WordPress, that typically means going to Appearance in the left navigation, opening Theme File Editor, selecting Theme Header (header.php), then pasting your Google tag snippet near the bottom of the head-related code area (your developer may prefer a specific placement, but the key is: it must render inside <head>). Save, then confirm the site is publicly accessible during testing (not behind maintenance mode or a password wall), otherwise tag verification tools can’t see it.

Important operational note: if you change WordPress themes later, you can lose the header.php edit and your tracking will quietly stop. If you must use this method, document it, and consider a child theme approach so updates don’t overwrite your work.

Step 3: Add the Conversion Event Snippet (or Use a URL-Based Conversion) Correctly

If you’re using an event snippet: put it only where the conversion happens

With direct Google tag installation, the most common “thank you page” approach is: keep the Google tag sitewide, then add the event snippet only on the page that represents the completed action (purchase confirmation, lead thank-you, booked demo confirmation, etc.). On a very simple site, that means placing the event snippet in the HTML of that conversion page after the Google tag.

On WordPress, how you add the event snippet depends on how the conversion page is built. If it’s a normal WordPress page with a stable URL, you might be able to place the event snippet through a page-specific header injection feature (some themes or plugins support this) or by using a dedicated tracking integration for your form/checkout plugin. The key principle is that the event snippet should fire once per real conversion, not on every visit and not on refresh loops.

If you can use URL-based (codeless) conversions: make the confirmation URL unambiguous

For lead gen sites especially, URL-based conversion setups can be excellent when your form redirects to something like /thank-you or /contact/thanks. The operational goal is to ensure that URL can’t be reached accidentally (for example, from your main navigation), otherwise you’ll record false conversions and your bidding will optimize toward the wrong users.

Verification & Troubleshooting: Make Sure WordPress Is Actually Sending Conversion Signals

What to check first (fastest path to “is it working?”)

  • Confirm the Google tag is present sitewide: Use a tag verification tool to confirm the Google tag loads on key templates (homepage, landing page, checkout/form page).
  • Confirm the conversion fires only on the intended action: Complete a real test conversion and confirm exactly one conversion event is sent (not zero, not multiple).
  • Check Google Ads conversion status: In the conversions area, review the conversion action’s status/diagnostics so you’re not guessing whether Google Ads is receiving events.

Common WordPress-specific issues I see (and how to fix them)

Caching/minification changes the tag execution order. Performance plugins can delay scripts, combine them, or move them out of the head. If your tags suddenly stop verifying after you “sped up the site,” temporarily disable script optimization, retest, then re-enable features one-by-one until you find the conflicting setting.

Maintenance mode blocks verification. If the site is only accessible via password or a “coming soon” wall, tag verification can fail and Google Ads may not reliably see conversion events during setup. Make sure the pages you’re testing are publicly accessible during implementation.

Pixel-only or incomplete implementations. Sometimes people paste only a tiny piece of the snippet (like a noscript image) instead of the full JavaScript-based setup. That can reduce reliability and lead to missing conversions. Use the full snippet provided in your account whenever possible.

Duplicate tagging. This is huge on WordPress: Site Kit plus another plugin plus theme-level code plus Tag Manager is a recipe for double-counting. Decide on one primary deployment method, remove the others, then retest.

Optimization Tips That Improve Ad Performance (Not Just “Tracking”) Once the Tag Is Installed

Turn on enhanced conversions (when appropriate) to improve match quality

If you’re tracking leads or purchases and you collect first-party customer data (like email or phone) at conversion time, enhanced conversions can improve measurement quality by securely hashing that data and using it to improve conversion attribution and modeling. This is especially valuable when cookie-based measurement is less reliable due to browser and privacy changes. Implement it thoughtfully, and only with proper disclosure and consent practices where required.

Make sure the “right” conversions are used for bidding

Inside Google Ads, conversion actions can be designated as primary or secondary, and campaigns optimize based on conversion goals that include those actions. In plain English: if you accidentally set a low-value action (like a page view) as the primary conversion used for optimization, your Smart Bidding will chase cheap, low-quality “conversions” and performance will look busy but not profitable.

A practical approach is to ensure your true business outcomes (purchases, qualified leads, booked appointments) are your primary optimization signals, while softer signals (add to cart, view key page) are secondary unless you have a deliberate strategy to use them for specific campaign types or ramp-up periods.

Let AI handle
the Google Ads grunt work

Try our AI Agents now
Section / Step What it covers Key WordPress actions Relevant Google Ads docs
Understand what the “Google Ads tracking code” is Explains that “tracking code” usually means a sitewide Google tag (gtag.js) plus a conversion-specific event snippet.

Clarifies the naming change from “global site tag” to “Google tag” and how tag IDs differ (AW- for Ads, G- for Analytics).
  • Confirm whether your existing implementation already has a Google tag in the <head> across all pages.
  • Identify whether you’re using an AW- tag (direct Google Ads conversions) or a G- tag (Analytics-led, importing into Ads).
Step 1 – Create / confirm your conversion action Focuses on configuring a web conversion action in Google Ads that reflects real business outcomes (purchases, qualified leads, key form submits).

Highlights that Smart Bidding needs accurate conversion definitions to optimize effectively.
  • In Google Ads, create or confirm a web conversion action that matches your core goal (e.g., Purchase, Qualified lead).
  • Decide whether you will track directly with the Google tag or import conversions from Analytics.
Step 1 – Choose URL-based vs event-based tracking Compares “codeless” URL-based conversions with manual event snippets.

URL-based works when a unique confirmation page reliably indicates a conversion; manual snippets (or Tag Manager) are better for click-based, dynamic, or revenue-rich tracking.
  • For simple thank-you pages, plan a unique URL (e.g., /thank-you) that only loads after a real conversion.
  • For button clicks, multi-step checkouts, or variable revenue, plan to implement a full event snippet (possibly via a form/checkout plugin or Tag Manager).
Step 2 – Option A: Use Site Kit (recommended) Recommends the official Site Kit plugin as the most stable, low-maintenance method for non-developers to add the Google tag to WordPress.

Explains how AW- vs G- tag IDs influence whether you connect Google Ads directly or rely on Analytics and imported conversions.
  • Install and activate Site Kit, complete its onboarding, and connect Google Ads or Analytics as appropriate.
  • Verify that the Google tag ID surfaced by Site Kit matches the one linked to your Google Ads conversions.
Step 2 – Option B: Use another analytics / measurement plugin Describes using a WordPress analytics plugin that manages Analytics and also lets you add an Ads-focused AW- tag ID.

Warns strongly against duplicate installs of the same Google tag from multiple sources.
  • Centralize measurement configuration in one main plugin if governance/reporting workflows require it.
  • Audit your theme, plugins, and Tag Manager to ensure the Google tag is installed only once.
Step 2 – Option C: Manual theme file install Covers placing the Google tag directly into header.php so it loads sitewide in the <head> section.

Notes that this is fast but fragile, because theme changes can silently remove the code.
  • In WordPress, go to Appearance → Theme File Editor → Theme Header and paste the Google tag inside <head>.
  • Document the change and consider a child theme so updates don’t overwrite the tag.
  • Ensure the site is publicly accessible (no maintenance/password wall) while testing.
Step 3 – Add the conversion event snippet Explains the standard “sitewide tag + event snippet on the thank-you page” pattern.

Stresses that the event snippet should fire once per true conversion and not on every visit or refresh.
  • Keep the Google tag sitewide; add the event snippet only on the true confirmation/thank-you page.
  • Use page-specific header injection or integration options provided by your form/checkout plugins where possible.
Step 3 – Use URL-based (codeless) conversions Shows how URL-based conversions are ideal when each conversion leads to a unique confirmation page.

Emphasizes making the confirmation URL unreachable via normal navigation to avoid false positives.
  • Configure your form or checkout to redirect to a dedicated thank-you URL such as /thank-you or /contact/thanks.
  • Ensure visitors can’t hit that URL without completing the action (no menu links, no test links in content).
Verification – Check that tracking is working Outlines a quick checklist: confirm the Google tag is present sitewide, confirm the conversion only fires on the intended action, and review conversion diagnostics in Google Ads.
  • Use a tag debugger to verify that the Google tag loads on your main templates and that the conversion event fires once after a real test conversion.
  • In Google Ads → Conversions, check the status and diagnostics for the conversion action.
WordPress-specific issues & fixes Highlights common pitfalls on WordPress: caching/minification altering script order, maintenance mode blocking verification, incomplete “pixel-only” snippets, and duplicate tags from multiple plugins or theme edits.
  • Temporarily disable script optimization and retest tags; then re-enable features one by one.
  • Ensure test pages are publicly accessible while implementing tracking.
  • Replace partial or legacy snippets with the full, current Google tag and event code from your account.
  • Standardize on one deployment method (Site Kit, a single plugin, manual code, or Tag Manager) and remove duplicates.
Optimization – Enhanced conversions Describes how enhanced conversions use hashed first-party data (like email or phone) to improve match quality, attribution, and modeling—especially helpful as cookie-based tracking becomes less reliable.
  • When legally and ethically appropriate, configure enhanced conversions to pass hashed customer data at conversion time.
  • Update privacy disclosures and consent flows as required before enabling enhanced conversions.
Optimization – Use the right conversions for bidding Explains the difference between primary (used for bidding) and secondary actions, and the risk of optimizing to low-value events like generic page views.

Recommends aligning primary conversions with high-value business outcomes.
  • Review your conversion goals and ensure purchases, qualified leads, or bookings are set as primary.
  • Keep softer events (add to cart, key page views) as secondary unless they are intentionally used for specific strategies.

Let AI handle
the Google Ads grunt work

Try our AI Agents now

Once you’ve added the Google tag sitewide in WordPress (via Site Kit, a single measurement plugin, or a careful manual install) and placed your conversion event snippet so it fires only on real thank-you or confirmation actions, the next challenge is making sure those conversions stay accurate as your theme, plugins, caching, and campaigns evolve. Blobr can help on the Google Ads side by connecting to your account, continuously checking performance signals, and turning best practices into practical recommendations through specialized AI agents—for example, improving landing page alignment with the Keyword Landing Optimizer or refreshing underperforming ad assets with the Headlines Enhancer—so your tracking setup actually translates into better optimization decisions over time.

Understand What “Google Ads Tracking Code” Actually Means on WordPress

When most advertisers say “Google Ads tracking code,” they’re usually referring to two pieces that work together: the sitewide Google tag (gtag.js) and a conversion event snippet that fires when a specific action happens (like a purchase, lead, or sign-up). The sitewide tag should appear across your entire WordPress site (typically in the <head>), while the event snippet is added only where the conversion should be recorded (often your “thank you” or order confirmation page).

One key platform change that still trips people up is naming: what used to be called the “global site tag” is now simply the Google tag. If you already have an older gtag.js implementation on your site, you generally don’t need to replace it just because the label changed; you focus instead on ensuring the right destinations and events are configured.

Also note the tag ID prefixes you’ll see inside the Google tag setup. A tag ID that starts with AW- is typically associated with Google Ads measurement, while a tag ID that starts with G- is typically associated with Google Analytics. Either can support strong Google Ads measurement, but your setup path will differ depending on whether you’re tracking conversions directly in Google Ads (common for lead gen) or importing conversions from Analytics (common when your Analytics event taxonomy is already mature).

Step 1: Generate the Correct Google Ads Conversion Tracking Code

Create (or confirm) your conversion action first

Before you touch WordPress, make sure Google Ads is actually expecting the right conversion. In your Google Ads account, create a web conversion action that matches your real business outcome (for example, “Purchase,” “Qualified lead,” or “Submit form”). This matters because your campaigns—and especially Smart Bidding—only get smarter when you feed them the right signals.

At the end of the conversion setup flow, you’ll be given instructions to implement measurement using either the Google tag directly or Google Tag Manager. If you choose direct installation, you’ll see (1) the Google tag (sitewide) and (2) an event snippet (conversion-specific). If you prefer a simpler setup and your conversions can be tied to a URL (like /thank-you), you may be able to create a URL-based (codeless) event that your Google tag can detect without you adding a separate event snippet on-page.

Decide whether you need “codeless” URL tracking or a true event snippet

URL-based conversion creation is fastest when the conversion is reliably represented by a unique page load (a dedicated confirmation URL that only appears after the action). If you need to track button clicks, dynamic checkout steps, variable revenue, transaction IDs, or anything more custom, you’ll usually want the manual event snippet approach (or Tag Manager), because it gives you precise control over when the conversion fires and what values are passed.

Step 2: Add the Google Tag to WordPress (Best Options, From Most Stable to Most Fragile)

Option A (recommended for most site owners): Install via the Site Kit plugin

If you want a clean, durable setup without editing theme files, a strong approach is using the official Site Kit plugin. Practically, this reduces the risk of your tag disappearing during theme changes and makes it easier for non-developers to manage measurement.

In a typical setup, you’ll install and activate the plugin, complete the plugin’s setup flow, then connect the service you’re measuring. If your tag ID starts with AW-, you’ll usually connect Google Ads and provide your Google tag ID to complete setup. If your tag ID starts with G-, you’ll typically connect Google Analytics by choosing the correct existing property, and then you can link/import conversions into Google Ads as needed (depending on how you want to structure reporting and optimization).

Option B: Install via a WordPress measurement plugin that integrates Analytics and tagging

If your organization already relies on a WordPress analytics plugin for governance, access control, or reporting workflows, you may choose a plugin-based install that first connects Analytics and then supports adding an Ads-oriented tag ID (AW-). This can work well when the business wants a “one dashboard” approach inside WordPress for measurement configuration.

The tradeoff is that you must be disciplined about avoiding duplicate installs (for example, the same Google tag installed by both the plugin and your theme, or by both the plugin and Tag Manager). Duplicate tagging is one of the most common causes of inflated conversions and confusing “it says it’s tracking, but numbers don’t make sense” problems.

Option C: Install manually using the WordPress Theme File Editor (fast, but easiest to break later)

If you can’t (or don’t want to) use plugins, you can paste the Google tag snippet into your theme’s header file so it loads sitewide. The standard approach is to place the Google tag snippet in the <head> section so it loads early and consistently.

In WordPress, that typically means going to Appearance in the left navigation, opening Theme File Editor, selecting Theme Header (header.php), then pasting your Google tag snippet near the bottom of the head-related code area (your developer may prefer a specific placement, but the key is: it must render inside <head>). Save, then confirm the site is publicly accessible during testing (not behind maintenance mode or a password wall), otherwise tag verification tools can’t see it.

Important operational note: if you change WordPress themes later, you can lose the header.php edit and your tracking will quietly stop. If you must use this method, document it, and consider a child theme approach so updates don’t overwrite your work.

Step 3: Add the Conversion Event Snippet (or Use a URL-Based Conversion) Correctly

If you’re using an event snippet: put it only where the conversion happens

With direct Google tag installation, the most common “thank you page” approach is: keep the Google tag sitewide, then add the event snippet only on the page that represents the completed action (purchase confirmation, lead thank-you, booked demo confirmation, etc.). On a very simple site, that means placing the event snippet in the HTML of that conversion page after the Google tag.

On WordPress, how you add the event snippet depends on how the conversion page is built. If it’s a normal WordPress page with a stable URL, you might be able to place the event snippet through a page-specific header injection feature (some themes or plugins support this) or by using a dedicated tracking integration for your form/checkout plugin. The key principle is that the event snippet should fire once per real conversion, not on every visit and not on refresh loops.

If you can use URL-based (codeless) conversions: make the confirmation URL unambiguous

For lead gen sites especially, URL-based conversion setups can be excellent when your form redirects to something like /thank-you or /contact/thanks. The operational goal is to ensure that URL can’t be reached accidentally (for example, from your main navigation), otherwise you’ll record false conversions and your bidding will optimize toward the wrong users.

Verification & Troubleshooting: Make Sure WordPress Is Actually Sending Conversion Signals

What to check first (fastest path to “is it working?”)

  • Confirm the Google tag is present sitewide: Use a tag verification tool to confirm the Google tag loads on key templates (homepage, landing page, checkout/form page).
  • Confirm the conversion fires only on the intended action: Complete a real test conversion and confirm exactly one conversion event is sent (not zero, not multiple).
  • Check Google Ads conversion status: In the conversions area, review the conversion action’s status/diagnostics so you’re not guessing whether Google Ads is receiving events.

Common WordPress-specific issues I see (and how to fix them)

Caching/minification changes the tag execution order. Performance plugins can delay scripts, combine them, or move them out of the head. If your tags suddenly stop verifying after you “sped up the site,” temporarily disable script optimization, retest, then re-enable features one-by-one until you find the conflicting setting.

Maintenance mode blocks verification. If the site is only accessible via password or a “coming soon” wall, tag verification can fail and Google Ads may not reliably see conversion events during setup. Make sure the pages you’re testing are publicly accessible during implementation.

Pixel-only or incomplete implementations. Sometimes people paste only a tiny piece of the snippet (like a noscript image) instead of the full JavaScript-based setup. That can reduce reliability and lead to missing conversions. Use the full snippet provided in your account whenever possible.

Duplicate tagging. This is huge on WordPress: Site Kit plus another plugin plus theme-level code plus Tag Manager is a recipe for double-counting. Decide on one primary deployment method, remove the others, then retest.

Optimization Tips That Improve Ad Performance (Not Just “Tracking”) Once the Tag Is Installed

Turn on enhanced conversions (when appropriate) to improve match quality

If you’re tracking leads or purchases and you collect first-party customer data (like email or phone) at conversion time, enhanced conversions can improve measurement quality by securely hashing that data and using it to improve conversion attribution and modeling. This is especially valuable when cookie-based measurement is less reliable due to browser and privacy changes. Implement it thoughtfully, and only with proper disclosure and consent practices where required.

Make sure the “right” conversions are used for bidding

Inside Google Ads, conversion actions can be designated as primary or secondary, and campaigns optimize based on conversion goals that include those actions. In plain English: if you accidentally set a low-value action (like a page view) as the primary conversion used for optimization, your Smart Bidding will chase cheap, low-quality “conversions” and performance will look busy but not profitable.

A practical approach is to ensure your true business outcomes (purchases, qualified leads, booked appointments) are your primary optimization signals, while softer signals (add to cart, view key page) are secondary unless you have a deliberate strategy to use them for specific campaign types or ramp-up periods.