Guide

GA4 Tracking: Setting Up Analytics, Tag Manager and Consent Mode Correctly

GA4 tracking shows you which marketing activities generate enquiries and revenue, provided Google Analytics 4, Google Tag Manager and Consent Mode work together properly. In this guide, we explain how to set up tracking in a privacy-compliant way and measure the right metrics.

Key points at a glance

  • GA4 measures events rather than page views. You mark important actions as key events.
  • Google Tag Manager brings all tracking codes together in one place.
  • In the EU, you need consent for analytics and marketing cookies, implemented with Consent Mode v2.
  • Set data retention in GA4 deliberately and state it in your privacy policy.
  • Test every event before going live and check your data regularly.

1. What is Google Analytics 4?

Google Analytics 4 (GA4) is Google’s current analytics tool for measuring visitors, behaviour and results on websites and in apps. It has completely replaced Universal Analytics.

The most important difference from its predecessor: GA4 records everything as an event. A page view, a click on a phone number and a purchase are each events. You mark particularly important events, such as an enquiry, as key events. These used to be called conversions.

2. Which tools do you need?

Solid GA4 tracking requires GA4 itself, Google Tag Manager, a cookie banner with Consent Mode and Google Search Console.

ToolPurpose
Google Analytics 4Analyse visitors, sources, behaviour and key events
Google Tag ManagerManage tracking codes centrally without changing the website code
Cookie banner (consent management)Obtain consent and pass it on to Google
Google Search ConsoleVisibility and clicks in Google Search
Google Ads conversion trackingAttribute enquiries and sales to your ads

3. What does data protection law require?

In the EU, analytics and marketing cookies may generally only be set after visitors have actively given their consent. Rejecting must be just as easy as accepting. This section does not replace legal advice.

  • A cookie banner with equivalent buttons for accepting and rejecting
  • No tracking cookies before consent is given
  • A privacy policy listing all services used, their purposes and storage periods
  • A data processing agreement with Google, which can be concluded in the account settings
  • The option to change consent at any time, for example via a link in the footer

Consent Mode v2 passes your visitors’ consent decisions on to Google services so that they only measure to the extent permitted. Since March 2024, it has been a prerequisite for advertisers in the European Economic Area to keep using features such as remarketing and personalised advertising.

SignalMeaning
analytics_storageMay an analytics cookie be set?
ad_storageMay an advertising cookie be set?
ad_user_dataMay user data be sent to Google for advertising purposes?
ad_personalizationMay personalised advertising, such as remarketing, be served?

There are two variants: in basic mode, the Google tags only load after consent has been given. In advanced mode, they send only cookieless signals without consent, which Google uses to model missing data. You should agree on the right variant with your data protection adviser. Many cookie tools such as Complianz, Usercentrics or Cookiebot support Consent Mode directly.

5. How do you set up GA4 step by step?

Setting up GA4 tracking for a typical business website takes just a few hours if you work in a structured way.

  1. Create a GA4 property and set the time zone and currency correctly
  2. Create a data stream for the website and note the measurement ID
  3. Install Google Tag Manager and set up the Google tag with the measurement ID
  4. Connect the cookie banner to Consent Mode and set the default values to “denied”
  5. Configure data retention: GA4 offers 2 or 14 months
  6. Exclude internal visits, for example from your office, as internal traffic
  7. Link Google Ads and Search Console to GA4

The retention period you choose in GA4 must match the information in your privacy policy.

6. Which events should you measure?

Measure the actions that have value for your business, and mark the most important ones as key events. GA4 automatically records many standard events, such as scrolling or file downloads, through enhanced measurement.

EventTypical forKey event?
Form submitted (generate_lead)Service providersYes
Click on phone number or emailService providers, local businessesYes
Purchase (purchase) with valueOnline shopsYes
Add to basket (add_to_cart)Online shopsNo, but important for analysis
Appointment bookingConsultants, practicesYes
Newsletter sign-upAllDepending on the goal

Trigger form events via the confirmation page or a clear success signal, not via the click on “Send”. Otherwise, failed attempts will be counted too.

7. How do you test your tracking?

Test every GA4 event before going live using Tag Manager’s preview mode and DebugView in GA4.

  • Start preview mode in Tag Manager and click through the website
  • Check that no tracking cookies are set before consent is given
  • After consent, check in GA4’s DebugView that all events are arriving
  • Carry out a test enquiry and a test purchase and check the values
  • Check in Google Ads that conversions are being imported

8. Which reports really matter?

For most businesses, a few GA4 reports are enough: traffic sources, key events by channel and the most important pages.

  • Acquisition: which channels do visitors and enquiries come from?
  • Key events: how many enquiries or sales were there, and from which source?
  • Pages and screens: which pages are read, and which lead to enquiries?
  • Referrals from AI assistants: visitors from chatgpt.com, perplexity.ai or gemini.google.com

Define UTM parameters for links in newsletters, social media and campaigns. GA4 can then attribute visitors clearly. To learn how to integrate channels and metrics into your overall planning, read our guide Digital marketing strategy.

9. What is server-side tracking?

With server-side tracking, measurement data first passes through your own server before it is sent to Google or other services. This improves data quality and gives you more control over which data is shared.

Server-side tracking does not replace visitor consent. It is particularly worthwhile for online shops and businesses with larger advertising budgets, where accurate data has a direct influence on bidding in Google Ads.

10. Which mistakes distort your data?

The most common tracking mistakes are duplicate code installations, missing consent signals and key events that fire too often or not at all. Errors like these often only come to light after months.

  • GA4 is embedded directly in the theme in addition to Tag Manager, so visits are counted twice
  • The form event already fires when “Send” is clicked
  • Internal visits heavily distort the data of small websites
  • Your own domain appears as a referral source, for example due to external payment pages
  • After a relaunch, tracking is missing on new pages

A practical example: an online shop records twice as many purchases as its shop system. The cause is a second, forgotten analytics plugin. Once it has been removed, the figures match, and the bidding strategy in Google Ads works with correct data again.

11. How do you use the data to make better decisions?

Tracking data is only valuable if you regularly base decisions on it: shifting budget, improving pages, expanding or discontinuing channels. A fixed monthly meeting with three questions helps: What worked? What didn’t? What are we changing?

The data from GA4 forms the basis for your digital marketing strategy and for profitable campaigns as described in our Google Ads guide. If you are planning a new website, build in tracking from the start, as described in our guide Create a website.

12. How long does the setup take?

For a typical business website, a clean basic GA4 setup with Consent Mode and the most important key events can be completed in one to two working days. Online shops with e-commerce tracking and several advertising channels need more time.

Also allow time for testing and a review after two to four weeks. Only then will you see whether all events arrive reliably and whether the figures match your enquiries and orders. In addition, check your tracking after every major change to the website, such as a new form, a new cookie banner or a relaunch.

Also pay attention to who has access to the accounts. GA4, Tag Manager and Google Ads should belong to your company. Service providers should only receive the permissions they need for their work.

Checklist: tracking set up correctly

Check these points

  • Cookie banner with a reject button and Consent Mode v2
  • No tracking cookies before consent
  • GA4 embedded via Tag Manager
  • Important actions marked as key events and tested
  • Data retention configured and stated in the privacy policy
  • Google Ads and Search Console linked
  • Monthly analysis firmly scheduled

Frequently asked questions about GA4 and tracking

Can Google Analytics 4 be used in compliance with the GDPR?

GA4 can be used in the EU if you obtain consent, conclude a data processing agreement with Google and provide transparent information in your privacy policy. Google is certified under the EU-US Data Privacy Framework. Have the specific implementation reviewed by your data protection adviser.

Why does GA4 show fewer visitors than before?

Because visitors who have not given consent are not recorded, or only to a limited extent. Depending on the target audience, only some visitors accept. With advanced Consent Mode, Google models part of the missing data, but the figures are never complete. That is why you should mainly compare trends and ratios rather than absolute visitor numbers.

Do I need Google Tag Manager?

Not necessarily, but it is highly recommended. With Tag Manager, you manage all tracking codes in one place, can make changes without programming and test them before publishing. This saves time and prevents errors. In addition, consent from the cookie banner can be taken into account centrally for all tags there.

How long does GA4 store data?

In the free version, you can set 2 or 14 months for user and event data. The default setting is 2 months. Aggregated standard reports are not affected. Choose the retention period deliberately and state it in your privacy policy. For year-on-year comparisons in your own analyses, 14 months is usually the sensible choice.

Are there alternatives to Google Analytics?

Yes, for example Matomo, which can also be run on your own servers. For businesses that use Google Ads, however, GA4 usually remains the most practical choice because of the direct integration. Other privacy-friendly alternatives are Plausible or Fathom. They provide less detail but, depending on the configuration, require fewer consents.

How do I measure calls made via the website?

Measure clicks on phone numbers as an event in Tag Manager and mark it as a key event. For more precise attribution, including calls from ads, Google Ads offers its own call assets with call conversions. This shows you which campaigns and pages actually generate calls, not just clicks.

Dipl.-Ing. Rida Mekaoui

About the author

Dipl.-Ing. Rida Mekaoui has worked in digital marketing since 2003 and runs Digital Targets in Larnaka, Cyprus, as its founder and managing director. He advises businesses across Europe on SEO, AI visibility, Google Ads, affiliate marketing and e-commerce.

More about us →

Want to know what your marketing delivers?

We set up GA4, Tag Manager and Consent Mode in a privacy-compliant way and show you which channels really generate enquiries and revenue.

+357 99 910 829