Setting up GA4, Google Ads and Meta Pixel with GTM: step by step

30 İyul 2026·Updated: ·⏱ ≈11 min·👁 205 views

Setting up GA4, Google Ads and Meta Pixel with GTM: step by step
Contents

In earlier posts, we explained what GTM is, how its interface works and the logic behind tracking. Now let’s move on to the practical details people ask about most: the four essential tracking setups your website needsSetting up GA4 with GTM and adding Google Ads and Meta Pixel tags are the key practical steps in setting up tracking on a website.

These form the foundation of measurement on a marketing website: use GA4 to understand user behaviour, Google Ads to track conversions, a remarketing tag to build audiences, and the Meta pixel to measure the results of social media advertising. We’ll cover the steps, the information you need and common mistakes for each.

👉 How tags, triggers and variables work

1. Setting up GA4: the foundation

The Google tag is the foundation of a GA4 setup. To send specific additional events, you create separate GA4 Event tags.

Step 1: Find your Measurement ID

Sign in to Google Analytics → Admin → Data streams → select your web stream. At the top, you’ll find the ID starting with `G-` Measurement ID starting with `G-`. Copy it.

Step 2: Create a Constant variable

Rather than entering the ID directly in your tags, create a variable first: Variables → User-Defined Variables → New → type: Constant, and enter your `G-` ID as the value. Name it `constant: ga4 measurement id`.

This may seem like extra work, but the benefit becomes clear straight away. When you later create ten or fifteen GA4 tags, they’ll all refer to this variable. If the ID changes or you switch to another property, you only need to update it in one place.

Step 3: Create a Google tag

Tags → New → Google tag. In the Tag ID field, select the variable you created. For the trigger, choose Initialization - All Pages Set the name to `GA4: Config: All Pages`.

This tag is the core of your GA4 setup: with the default settings, it sends page views and automatically collected events, and enables session measurement.

Step 4: GA4 Event tags

Once the core setup is in place, create tags to measure specific events using the Google Analytics: GA4 Event tag type. Each tag sends a separate event, such as `scroll_depth`, `button_click` or `generate_lead`. Use the same `constant` variable for each one.

Step 5: Test

Click Preview and enter your website address. Once you see the “Tag Assistant connected” message, browse the site. In the debug panel, check that the `GA4: Config: All Pages` tag Tags Fired .

For a second check, open GA4 and go to Reports → Realtime. You should see your visit there within a few minutes. If you don’t, check the tag, Measurement ID, consent settings and any tools that block traffic.

2. Google Ads conversion tracking

This is one of the most commonly misconfigured parts, and the mistake can cost you directly: if conversions aren’t measured correctly, Google’s automated bidding strategies will rely on inaccurate data.

Start with Conversion Linker

For the conversion tag only after check that the Google tag is firing on all pages. If it is, you don’t need a separate Conversion Linker. If it isn’t, create this tag to preserve click information and support attribution.

Tags → New → Conversion Linker. Trigger: All Pages. No additional parameters are needed for a standard setup. If you have a specific requirement, such as cross-domain tracking, check the relevant settings too.

Create a conversion action in Google Ads

In Google Ads, go to Goals → Conversions → Summary → Create conversion action → Conversions on a website. Select your website and manual setup, then choose a category (for example, “Submit lead form” for a lead form) and enter a name.

Then configure three settings:

  • Value: the monetary value of the conversion. If you know the approximate value of each lead, enter it; if not, choose “Don't use a value”.
  • Count: choose “One” or “Every”. For enquiry forms, select “One” (one conversion per ad click); for e-commerce sales, select “Every”.
  • Attribution window: how long after an interaction with an ad a conversion can still be attributed to that ad.

Once you have created the conversion action, Google will display setup instructions. Select Google Tag Manager Choose the option: you’ll need two values: Conversion ID and Conversion Label.

Set up the tag in GTM

Tags → New → Google Ads Conversion Tracking. Fill in the Conversion ID and Conversion Label fields.

Now for the most important part: the trigger. Don’t assign All Pages to this form’s conversion tag, or every page view will count as a conversion. Identify the thank-you page users reach after successfully submitting the form, then set up a trigger:

Trigger type: Page View. Condition: Page Path contains /thank-you.

Testing

Open Preview mode and complete and submit the form yourself. In the debug panel, check two things: the Google tag, or Conversion Linker if needed, fires as soon as the page loads, while the conversion tag fires only when you reach the thank-you page Tags Fired only when you reach the thank-you page.

Many specialists skip this step, publish the tag and then see zero conversions in Google Ads a week later. One test costs less than a week of lost data.

3. Google Ads remarketing tag

Remarketing means targeting people with ads after they’ve visited your website but left without taking the action you wanted. For it to work, visitors need to be added to an audience list.

Create an audience list

Google Ads → Tools → Shared library → Audience manager → Segments → new segment → Website visitors. Give the list a name and define its conditions: all visitors, people who viewed a specific page, or people who didn’t convert.

Get your Conversion ID

Google Ads → Tools → Shared library → Audience manager → Your data sources → Google Ads tag → Details → Tag setup. From the setup options, choose Google Tag Manager . Conversion ID .

Set up the tag in GTM

Tags → New → Google Ads Remarketing. Enter your Conversion ID. Trigger: All PagesFor an audience list covering all visitors, this is the right choice; remember to account for the tag’s consent settings too.

Name it `Google Ads: Remarketing: All Pages` and publish it. After a few days, check that the list is starting to populate in Audience manager. Note: to use an audience in ads, it must meet the minimum size requirement for the relevant network.

4. Meta Pixel: setting up without a built-in GTM template

GTM also offers built-in tags and community templates for third-party platforms. You can also set up the Meta pixel using the Custom HTML tag.

Get the pixel code

Meta Business Suite → Events Manager → Connect data → Web. Create a data source or select an existing one. For Meta Pixel setup, you can use a partner integration or set it up manually. To add the code yourself, use manual option and copy the pixel code.

The two parts of the code

Look closely and you will see that the code has two parts:

  • The `<script>` section: the main pixel code. It works when JavaScript is enabled and requests aren’t blocked.
  • The `<noscript>` section: an image request sent directly from the page’s HTML when JavaScript is disabled.

In GTM, use only the script section. The `noscript` section can’t run through GTM when JavaScript is disabled. Its presence in the code does not, by itself, mean visits will be counted twice.

Set up the main tag

Tags → New → Custom HTML. Paste only the `<script>` section of the code. In Advanced Settings, set Tag Firing Priority Setting a value such as `10` changes the firing order; it doesn’t guarantee that loading will finish first. Trigger: All Pages.

A separate tag for the noscript section

Don’t create a second Custom HTML tag for the `<noscript>` section. When JavaScript is disabled, GTM’s JavaScript container won’t run either, so no trigger can fire that tag.

You can’t check this with a Custom JavaScript variable either: if JavaScript is disabled, the variable won’t run. A trigger based on its value can’t make this setup work.

Practical note: if you need the `noscript` section, ask a developer to add it directly to your website’s HTML, and account for your consent mechanism. In GTM, set up and check the main script section.

Marking an event as a conversion in GA4

Sending an event from GTM is only half the job. GA4 records the event, but you also need to tell it separately that the event important is important to your business.

So once the event reaches GA4, go to Admin → Data display → Events. Find your event in the list (it can take up to 24 hours to appear) and mark it with the star icon key event as a key event.

The event will then appear as a key event in GA4 reports. To use it as a conversion in Google Ads, you need to create a separate conversion. Skipping this step is a common mistake: the data comes in, but the result you expect doesn’t appear in your reports.

There’s also a convention for naming events. For consistency, it’s best to use lowercase letters and underscores names like `generate_lead`, `button_click` and `scroll_depth`: no spaces, though uppercase letters are allowed. GA4 records `Button_Click` and `button_click` as two different events.

Which events should you track? The essentials

When starting a new project, don’t try to measure everything at once. This list gives you a minimum set for different types of business: start with these, then expand.

For service businesses and B2B websites

  • Successful contact form submission: your primary conversion.
  • Click on a phone number (essential for mobile traffic).
  • Click on the WhatsApp or Messenger button.
  • Pricing page views.
  • PDF or catalogue download.

For e-commerce websites

  • Product views.
  • Add to cart.
  • Start of the payment process.
  • Purchase completed, including value and currency parameters.
  • Use of search and the search query.

For content websites

  • How far down the page someone scrolls in an article.
  • Successful subscription form submission.
  • Outbound link clicks.
  • Video viewing milestones.

Key principle: Every event you measure should help you make a decision. Events added because “it’s interesting, let’s measure it” eventually become a pile of data nobody looks at, while making the setup unnecessarily complicated.

GA4 setup and other tags: a pre-publishing test checklist

Never publish a tag without checking it. Follow these steps:

  1. Preview is the button to click, then enter your website address.
  2. Wait for the “Tag Assistant connected” message after your website opens in a new window or tab.
  3. On your website, behave like a real user Carry out the actions you want to track: move between pages, scroll, click buttons, and complete and submit the form.
  4. Check each event in the debug panel. The event stream on the left records the actions being tracked.
  5. Tags Fired is the list to check: does it contain the tags you expected to fire? Tags Not Fired Is there a tag in the
  6. list that should have fired but didn’t?
  7. Variables Click the tag’s name and check its settings: are the values correct, and are any fields empty?
  8. Only then click Submit In the tab, check the actual values of your variables. Publish.

There’s one more step after publishing: 24 hours later, check your GA4 and Google Ads accounts to make sure data is coming through. A tag that works in Preview mode may behave differently on the live site because of cookie and consent settings.

When something goes wrong: a troubleshooting checklist

If the debug panel will not open or tags are not firing, check the following in order:

  • Browser. There’s one more step after publishing: check your GA4 and Google Ads accounts 24 hours later to confirm the data is coming through. A tag that works in Preview mode may behave differently on the website because of cookies and consent settings.
  • Incognito mode. Start by checking in Chrome. The Tag Assistant extension is for Chrome; that doesn’t mean the web debug panel only works in Chrome.
  • Third-party cookies. Cookie and extension restrictions in an Incognito window may prevent the connection. Try a regular window too.
  • Ad blockers. Check your browser’s privacy settings. Cookie restrictions may prevent the connection; if needed, add an appropriate exception for testing.
  • uBlock, AdBlock and similar tools may block GTM requests. Turn them off while testing. Privacy extensions can also interfere. If you’re unsure, check in a browser profile without any extensions.
  • Wrong container. Privacy extensions can also interfere. If in doubt, try a browser profile without extensions.
  • Cache. If the panel has only partially loaded, hard-refresh the page (Cmd+Shift+R / Ctrl+Shift+R).
  • If you work with several clients, make sure the `GTM-XXXXXXX` identifier in the debug panel is correct. If you use a tool such as Adswerve, check that the GTM ID entered there is correct.

If you use a tool such as Adswerve, check that the GTM ID entered there is correct.

Conclusion

If none of this works, check the website setup: the container code may be missing from some pages, or security settings may be blocking requests. At this point, contact a web developer.

These four setups (GA4, Google Ads conversion tracking, remarketing and the Meta pixel) form the foundation of measurement on commercial websites. Once they’re set up correctly, you can see in the numbers which of your campaigns are delivering results. But remember: these setups primarily measure, measures page views and conversions. To see in detail what users do on a page, how much of the content they read and which buttons they click, you need to set up additional tracking. In the next post, we’ll track these behaviours.

Frequently asked questions

What happens if I install GA4 both directly and through GTM?

, page views and conversions. To see in detail what users do on a page, how much of the content they read and which buttons they click, you’ll need additional tracking. In the next post, we’ll look at these behaviours.

Do I really need Conversion Linker?

If both setups send `page_view` to the same stream, page views may be recorded twice. The effect on other metrics depends on the setup. When moving to GTM, stop duplicate sends from the old code.

Would using Meta Pixel’s partner integration be easier?

If the Google tag loads on every page, you don’t need a separate Conversion Linker. If it doesn’t, set one up to preserve ad click information and attribute conversions. Check that it works in Preview mode before publishing.

How do I set up a conversion tag without a thank-you page?

If submitting the form does not open a separate page, you have two options: use a Form Submission Yes, for a quick setup. With the manual option, you manage the code yourself: you can set a firing priority, add custom events and control when the tag fires. Choose based on the project’s needs and the integration’s capabilities.

Do consent settings affect my setup?

Yes, especially if you work with a European audience. In the basic version of consent mode, Google tags are blocked when consent is not given. In the advanced version, cookieless measurement requests can be sent when consent is declined. This difference also affects test results.

trigger, or ask a developer to send a custom event to the data layer when the form is successfully submitted. The second option is more reliable; with the first, check separately that the submission was successful.

Is it safe to use GA4, Meta and other pixels in the same container?

Yes, especially if you work with audiences in Europe. In basic consent mode, Google tags are blocked if consent hasn’t been given; in advanced mode, cookieless measurement requests may be sent when consent is denied. This difference also affects test results.

I have published, but no data is coming through. How long should I wait?

A practical approach: if your website has a cookie banner, make sure it’s properly integrated with consent mode through GTM. Set up separate consent checks for other tags, such as Meta’s, too. Otherwise, you may lose data or collect it against users’ consent choices.

Topic: Google Tag Manager: posts in this topic →

Tural Rəhimov

About the author

Tural Rəhimov

Digital Marketing Manager: UM Azerbaijan

Digital marketing manager at Universal McCann (UM Azerbaijan). Experienced in Google Ads, Meta Ads, TikTok Ads and media planning. I help brands grow online.

More about me →

Need digital marketing support for your business?

Let's talk: I can help with everything from strategy to ad management.

Message me