Skip to main content

Google Tag Manager, Analytics & Ads — Setup Documentation


Table of Contents

  1. The Analogy — Understanding the System
  2. The Three Google Products We Use
  3. How Data Flows Between Products
  4. What Is a "Google Tag" and Why Do We Need Two?
  5. Our GTM Container — Tags, Triggers & Variables
  6. The Six Google Ads Tag Types in GTM (Explained)
  7. Our Current Production Setup
  8. Tag Firing Order and Why It Matters
  9. The "Deferred Hits" Problem and How We Solved It
  10. Environment-Specific Configuration (RegEx Tables)
  11. Verifying the Setup with Tag Assistant
  12. Key Identifiers Reference
  13. How to Make Changes

1. The Analogy — Understanding the System

Think of our website measurement system like the plumbing in an office building.

Google Tag Manager (GTM) is the pipe system. It's the single piece of infrastructure installed in the walls of the building (our website). Every faucet, sprinkler, and drain connects through these pipes. We install GTM once in our HTML source code, and everything else flows through it.

Google Analytics 4 (GA4) is one faucet — the analytics dashboard. When a user views a job listing, scrolls the page, or triggers an ecommerce event, the data flows through GTM's pipes to this faucet, where we can analyze user behavior and understand how people use our site.

Google Ads is another faucet — the advertising dashboard. When a user clicks one of our ads and later views a job or signs up, the data flows through GTM's pipes to this faucet, where Google Ads can measure whether our ad spend is working.

Google Tags are the valves on each faucet. Before water can flow to a faucet, the valve must be opened first. Each faucet (GA4 and Google Ads) has its own valve (Google Tag) that must be turned on before any data can flow. If you try to send water to a faucet without opening its valve first, the water gets "deferred" — it backs up and waits. This is exactly why we need both a GA4 Google Tag AND a Google Ads Google Tag in our GTM container.

The Conversion Linker is like a label printer attached to the pipes — when someone enters the building through a specific door (an ad click), it stamps a label (the gclid cookie) on them so that when they later reach the Ads faucet, Google Ads knows which ad brought them in.

The Remarketing tag is like a security camera at the front desk — it records who visited the building so we can later show them targeted ads to come back.


2. The Three Google Products We Use

Google Tag Manager (GTM)

GTM is a tag management system. Instead of hardcoding tracking scripts directly into our website's HTML, we install a single GTM snippet and then manage all our tracking tags through GTM's web interface. This means marketing and analytics can add, modify, or remove tracking without requiring code deployments.

Our GTM container ID is GTM-NKWB9VWN. It is installed as the only Google-related script in our HTML source code. Everything else (GA4 scripts, Google Ads scripts, etc.) is loaded dynamically by GTM at runtime.

Google Analytics 4 (GA4)

GA4 is our web analytics platform. It tracks user behavior on our website — pageviews, scroll depth, ecommerce events (view_item, select_item, view_item_list), and custom events. We use it to understand how users interact with our job board.

Our GA4 Measurement IDs are environment-specific (see Section 10).

Google Ads is our advertising platform. We run campaigns to drive traffic to our job board. Google Ads needs data from our website to measure campaign effectiveness — specifically, it needs to know when ad clicks lead to valuable actions (conversions) and who visited our site (for remarketing/retargeting).

Our Google Ads account is "Jobs on Demand" with Conversion ID AW-10788443175.


3. How Data Flows Between Products

There are two pathways for data to reach Google Ads:

Direct pathway: The Remarketing tag and Conversion Linker send data directly from our website to Google Ads. This is how remarketing audiences are built and how ad clicks are attributed to conversions.

Indirect pathway (via GA4): GA4 collects events from our website. We've linked our GA4 property to Google Ads, and we've imported the view_item_jodapp GA4 event as a Google Ads conversion. This means the conversion data flows from our website → GA4 → Google Ads.


4. What Is a "Google Tag" and Why Do We Need Two?

This is the most confusing part of Google's ecosystem, and the source of much of the complexity we encountered during setup.

The Google Tag — One Technology, Multiple Instances

A Google Tag is a unified infrastructure layer that Google introduced to simplify tracking. The idea: instead of having completely separate tracking systems for GA4 and Google Ads, there is one shared foundation — the Google Tag — that can route data to multiple Google products.

A Google Tag issues a gtag('config', ...) call, which tells Google's infrastructure: "Initialize a connection to this Google product. I am ready to send and receive data." Without this config call, any events sent to that product will be deferred (queued but not processed).

Google Tag IDs

Google Tags have IDs with different prefixes depending on where they were created:

  • G-XXXXXXX — Created from a GA4 data stream. Configuring this ID sets up the connection to GA4.
  • AW-XXXXXXX — A Conversion ID tied to a Google Ads account.
  • GT-XXXXXXX — A newer Google Tag ID that can be linked to either or both GA4 and Google Ads via "destinations" in Google's admin settings.

Why We Need Both

Our GA4 Google Tag (using G-LNFY0YRZD8) opens the valve to GA4. Our Ads Google Tag (using GT-WR93SDNT) opens the valve to Google Ads (AW-10788443175). They are separate valves for separate products.

Even though the underlying gtag.js JavaScript library is shared, each product needs its own config call. When our Remarketing tag fires and sends an event to AW-10788443175, Google's system checks: "Was there a config call for this Ads account?" If there wasn't — if the Ads Google Tag didn't fire first — the event becomes a "deferred hit" and may not be processed correctly.

The Google Tag Container (Not the Same as GTM)

When you create a Google Tag in Google Ads, Google automatically creates a Google Tag container in the Tag Manager infrastructure. This is a separate entity from your GTM container. In our case:

  • Our GTM container: Account 6326806675, Container 237302885 (GTM-NKWB9VWN)
  • The Google Ads Google Tag container: Account 6340160014, Container 244057004 (GT-WR93SDNT)

The Google Tag container holds the configuration for the GT-WR93SDNT tag — its destinations (Jobs on Demand / AW-10788443175), its settings (automatic event detection, domain configuration, user-provided data capabilities), and its admin users. You can view and manage it at tagmanager.google.com under the Google Tag container, but you should not confuse it with our actual GTM container where our tags live.


5. Our GTM Container — Tags, Triggers & Variables

Container Details

PropertyValue
Container Namejodapp.com
Container IDGTM-NKWB9VWN
AccountJodapp SG (6326806675)
Container237302885

Tags

Tag NameTag TypeTag ID / ConfigTrigger(s)Purpose
Google Tag - GA4Google Tag{{GA4 RegEx Table}}G-LNFY0YRZD8 (prod)Initialization - All Pages, History ChangeInitializes GA4. The config call opens the GA4 valve. Also fires on History Change for SPA navigation.
Google Tag - AdsGoogle Tag{{GAds Regex Host}}GT-WR93SDNT (prod)Initialization - All PagesInitializes Google Ads. The config call opens the Ads valve. Required to prevent deferred hits.
Conversion LinkerConversion Linker(none needed)Initialization - All PagesReads the gclid parameter from the URL (appended when a user clicks a Google Ad) and stores it in a first-party cookie. This allows Google Ads to attribute future conversions back to the original ad click.
Google Ads RemarketingGoogle Ads RemarketingAW-10788443175All PagesSends a signal to Google Ads on every page load, building remarketing audience lists so we can retarget website visitors with ads.
GA4 Event - EcommerceGA4 Event{{GA4 RegEx Table}}GA4 - Universal Ecommerce ItemsSends ecommerce events (view_item, select_item, etc.) to GA4 with item-level data (item_id, item_name, item_category, currency, etc.).
GA4 Event - scroll_depthGA4 Event{{GA4 RegEx Table}}Trigger - Scroll DepthSends scroll depth events to GA4, tracking how far users scroll on each page.

Triggers

Trigger NameTypeDescription
Initialization - All PagesInitializationFires before all other trigger types. Used for tags that must run first (Google Tags, Conversion Linker).
All PagesPage ViewFires on every page view. Used for Remarketing tag.
History ChangeHistory ChangeFires when the browser history changes (SPA navigation). Used for GA4 tag on single-page app navigation.
GA4 - Universal Ecommerce ItemsCustom EventFires on ecommerce data layer events.
Trigger - Scroll DepthScroll DepthFires when the user scrolls to configured thresholds.

User-Defined Variables

Variable NameTypeInput VariablePurpose
GA4 RegEx TableRegEx Table{{Page Hostname}}Maps the current hostname to the correct GA4 Measurement ID for each environment (see Section 10).
GAds Regex HostRegEx Table{{Page Hostname}}Maps the current hostname to the correct Google Ads Tag ID. Only jodapp.com returns GT-WR93SDNT. Other environments return nothing (tag doesn't fire).

6. The Six Google Ads Tag Types in GTM (Explained)

When you create a new tag in GTM and expand "Google Ads," you'll see six tag types. Here's what each one does and whether we use it:

Google Ads (Google Tag) — This is the foundational config/initialization tag for Google Ads. It issues the gtag('config') call that tells Google's infrastructure this Ads account is ready to receive events. We use this as "Google Tag - Ads" with ID GT-WR93SDNT. We use this. ✅

Conversion Linker — A helper tag that reads the Google Click ID (gclid) from the URL and stores it in a first-party cookie. Without this, conversion attribution (knowing which ad click led to a conversion) may fail, especially with browsers that restrict third-party cookies. We use this. ✅

Google Ads Conversion Tracking — Fires when a user completes a specific valuable action (form submission, purchase, sign-up). It tells Google Ads: "This specific click resulted in a conversion." You configure one tag per conversion action with a specific Conversion ID and Conversion Label. We do not currently use this directly — we import conversions from GA4 instead.

Google Ads Remarketing — Fires on every page to tell Google Ads who visited our site. This builds audience lists that can be used for retargeting campaigns (showing ads to people who previously visited our site). We use this. ✅

Google Ads Calls From Website Conversion — Replaces phone numbers on the site with Google forwarding numbers so Google can track phone call conversions. We do not use this.

Google Ads User-provided Data Event — Sends hashed first-party user data (like email addresses) to Google Ads to improve conversion measurement accuracy (Enhanced Conversions). We do not currently use this — it's an advanced feature for the future.


7. Our Current Production Setup

What's in Our HTML Source Code

Our website's HTML source contains exactly two Google-related elements:

  1. An inline <script> that initializes the dataLayer array and loads the GTM container (googletagmanager.com/gtm.js)
  2. A <noscript> fallback for GTM in the <body>

There are no hardcoded gtag.js scripts, no gtag('config') calls, and no gtag('js') calls in our source code. Everything is loaded dynamically by GTM. This is the correct setup — GTM is the single point of entry.

When GTM loads, it dynamically injects gtag.js (the Google Tag library) as needed, which appears in the browser's Elements tab as additional <script> elements. These are runtime-injected, not in the source.

Conversion Actions

Our Google Ads conversion actions are primarily mobile app conversions (via Firebase). For web, we have one active conversion:

  • jodapp.prod.web (web) view_item_jodapp — Source: Website (Google Analytics (GA4)) — This is a GA4 event that has been imported into Google Ads as a conversion action. It tracks when users view a job item on the website.

Connected Products (in Google Ads)

Our Google Ads account has the following connected products:

  • Google Analytics (GA4) — 2 properties linked
  • Third-party app analytics — 2 linked
  • YouTube — 1 linked

8. Tag Firing Order and Why It Matters

GTM fires tags in a specific order based on trigger types. This order is critical for our setup to work correctly.

The "Initialization" trigger type fires before all other triggers including "All Pages." This ensures:

  1. The GA4 config call happens before any GA4 events are sent
  2. The Ads config call happens before any Ads events (Remarketing) are sent
  3. The Conversion Linker stores the gclid cookie before any conversion-related data flows

If the Ads Google Tag did not fire at Initialization, the Remarketing tag's hits would become "deferred" — meaning Google received the remarketing event but couldn't process it because the Ads account hadn't been configured yet.


9. The "Deferred Hits" Problem and How We Solved It

The Problem

During our initial setup, we added the Conversion Linker and Remarketing tags but removed the Google Ads Google Tag (thinking it was redundant because the GA4 Google Tag already loaded the shared gtag.js infrastructure).

In Tag Assistant, we saw a warning on the GT-WR93SDNT tab:

Deferred hits: Some hits will not be sent until a config command is provided, either via a gtag('config') call or a Google tag in Tag Manager.

The info tooltip was explicit:

This Google tag should have been loaded before sending any events. To resolve this, add a Google tag for AW-10788443175 to your container in addition to any conversion linker, Google Ads, or Floodlight tags. Make sure the Google tag is set to fire on the "Initialization - All Pages" trigger.

Why It Happened

The GA4 Google Tag issues gtag('config', 'G-LNFY0YRZD8') — this opens the valve to GA4. But it does not open the valve to Google Ads. The Remarketing tag sends events to AW-10788443175, but no gtag('config') call had been made for that Ads account. Google's system received the remarketing event but had no initialized configuration for the destination, so it deferred the hit.

Loading gtag.js (the JavaScript library) is not the same as configuring a destination. Think of it this way: loading gtag.js is like turning on the water main for the building, but each faucet still needs its individual valve opened via a config call.

The Solution

We re-added the Google Ads Google Tag (GT-WR93SDNT) to our GTM container, set to fire on "Initialization - All Pages." This ensures the gtag('config') call for the Ads account happens before the Remarketing tag fires.

Key Lesson

Even though the GA4 and Ads Google Tags share the same underlying gtag.js library, each Google product destination requires its own gtag('config') call. Loading the library is step one; configuring each destination is step two.


10. Environment-Specific Configuration (RegEx Tables)

We use RegEx Table variables in GTM to dynamically select the correct tag IDs based on the hostname. This prevents test/staging environments from sending data to production GA4 properties or triggering production Google Ads events.

GA4 RegEx Table ({{GA4 RegEx Table}})

PatternOutput (GA4 Measurement ID)Environment
localhostG-40S32CM1K2Local development
^.+\.jod\.com\.sg$G-8ND7SQKWHKSingapore staging
^(.*\.)?jodapp\.dev$G-8ND7SQKWHKDev environment
^(.*\.)?jodapp\.com$G-LNFY0YRZD8Production
Default valueG-8ND7SQKWHKFallback

GAds Regex Host ({{GAds Regex Host}})

PatternOutput (Google Tag ID)Environment
localhost(empty — tag doesn't fire)Local development
^.+\.jod\.com\.sg$(empty — tag doesn't fire)Singapore staging
^(.*\.)?jodapp\.dev$(empty — tag doesn't fire)Dev environment
^(.*\.)?jodapp\.com$GT-WR93SDNTProduction only

The Ads variable intentionally returns nothing for non-production environments. When a Google Tag's ID is empty, the tag effectively doesn't fire. This means Google Ads Remarketing and the Ads Google Tag only run in production — preventing test traffic from polluting ad audiences and conversion data.


11. Verifying the Setup with Tag Assistant

Google Tag Assistant is the primary tool for verifying that tags are firing correctly.

How to Access

  1. In GTM, click "Preview" in the top-right
  2. Enter your website URL (e.g., https://jodapp.com)
  3. Tag Assistant opens in a new tab, connected to your site

What You Should See

Top bar: Three Google tags found:

  • GTM-NKWB9VWN — your GTM container
  • G-LNFY0YRZD8 — your GA4 property
  • GT-WR93SDNT — your Google Ads tag (appears because the Remarketing tag communicates with this Ads account)

GTM tab → Summary: All tags should show as "Tags Fired" with none under "Tags Not Fired":

  • Google Tag - GA4 — Fired 2+ times (Initialization + History Change)
  • Google Tag - Ads — Fired 1 time
  • Conversion Linker — Fired 1 time
  • Google Ads Remarketing — Fired 1 time
  • GA4 Event - Ecommerce — Fired on ecommerce events
  • GA4 Event - scroll_depth — Fired on scroll events

GT-WR93SDNT tab → Summary: Should show:

  • Tag quality: Excellent
  • Remarketing hit sent to AW-10788443175
  • No "Deferred hits" warning (if the Ads Google Tag is properly configured)

When clicking a view_item event (in GTM view): Should show "GA4 Event - Ecommerce" under "Tags Fired" with the full ecommerce data payload (item_id, item_name, item_category, currency, etc.) being sent to G-LNFY0YRZD8.

The GT-WR93SDNT Tag Will Always Appear

Even after removing the Google Ads Tag from GTM, the GT-WR93SDNT tag appeared in Tag Assistant. This is because it's not coming from a GTM tag — it's the Google Tag Container that automatically activates when any tag communicates with the associated Ads account (AW-10788443175). The Remarketing tag sends data to this Ads account, which triggers the GT tag to appear. This is normal and expected.


12. Key Identifiers Reference

IdentifierTypeProductPurpose
GTM-NKWB9VWNGTM Container IDGoogle Tag ManagerOur tag management container, installed in the website HTML
G-LNFY0YRZD8GA4 Measurement IDGoogle Analytics 4Production GA4 data stream
G-8ND7SQKWHKGA4 Measurement IDGoogle Analytics 4Staging/dev GA4 data stream
G-40S32CM1K2GA4 Measurement IDGoogle Analytics 4Localhost GA4 data stream
GT-WR93SDNTGoogle Tag IDGoogle AdsGoogle Tag that routes to our Ads account
AW-10788443175Conversion IDGoogle AdsOur Google Ads account "Jobs on Demand"

Account/Container IDs

AccountContainerPurpose
6326806675 / 237302885GTM-NKWB9VWNOur GTM container (where we manage tags)
6340160014 / 244057004GT-WR93SDNTGoogle Tag container (auto-created by Google Ads, do not modify)

13. How to Make Changes

Adding a New Tag

  1. Go to tagmanager.google.com, navigate to the jodapp.com container
  2. Click Tags → New
  3. Configure the tag type, ID, and trigger
  4. Click Save
  5. Click Preview to test with Tag Assistant before publishing
  6. Once verified, click Submit to publish a new container version
  7. Add a descriptive version name (e.g., "Added purchase conversion tracking tag")

Adding a Conversion Tracking Tag (Future)

If we want to track specific website conversions (like job applications or sign-ups) directly in Google Ads (rather than importing from GA4):

  1. Create a conversion action in Google Ads (Goals → Conversions → + Create conversion action)
  2. Copy the Conversion ID and Conversion Label
  3. In GTM, add a new tag: Google Ads Conversion Tracking
  4. Enter the Conversion ID (AW-10788443175) and the Conversion Label
  5. Set the trigger to the specific event that represents the conversion
  6. The Conversion Linker and Google Tag - Ads are already in place, so no additional setup needed

Important: Never Modify the Google Tag Container

The container at accounts/6340160014/containers/244057004 is the Google Tag container for GT-WR93SDNT. It's auto-managed by Google Ads. Do not modify its destinations, combine it with other tags, or change its settings unless you fully understand the implications. Our tags and configuration live in the GTM container (accounts/6326806675/containers/237302885).