How to Set Up Google Analytics 4: Step by Step and Privacy-Conscious

Setting up Google Analytics 4 step by step, from property and data stream to key events—with proper consent and Consent Mode v2.

Universal Analytics stopped processing data on July 1, 2023. So if you want to analyze your website with Google, you need to set up Google Analytics 4. GA4 is event-based: instead of sessions and pageviews, everything is built on events. A pageview is one of them, and so is a click or a purchase.

In this guide we walk you through setting up GA4 step by step. Just as important as the technical side are two things that often get overlooked: settings you should choose deliberately, and getting consent before measurement starts.

Before You Start: What Do You Want to Know?

First, figure out which questions your analytics should answer and what counts as success. Usually it comes down to a handful of goals: an inquiry, a phone call, a booked appointment or a purchase. That tells you which events to measure.

Also ask yourself whether you need GA4 at all. For visitor numbers, traffic sources and popular pages, cookieless analytics on your own server is often enough—and in many cases doesn’t require consent. GA4 is worth it if you want to evaluate ad campaigns, attribute online store revenue or connect your data with Google Ads. We cover both approaches on our Tracking & Analytics page.

Our own website is an example of the data-minimizing route: no analytics cookies, appointment booking without an external service and fonts hosted on our own server.

Setting Up Google Analytics 4: Step by Step

You’ll need a Google account—use one that belongs to your business, not an individual employee’s personal account. That way, access and data stay in your hands even when responsibilities change. Agencies get their own access.

  1. Create an account and property: In Google Analytics, create an account for your business and, within it, a property for your website, with the time zone set to Germany and the currency to euros.
  2. Create a data stream: Add a “Web” data stream with your website’s URL. You’ll get a measurement ID that starts with “G-“.
  3. Add the tag: We recommend Google Tag Manager: you add its code once and create a Google tag with your measurement ID there—and later your events and ad tags, too. Alternatively, you can add the Google tag directly to the page header. For GA4 in WordPress, both work via a plugin or in the theme—just pick exactly one method.
  4. Review enhanced measurement: “Enhanced measurement” in the data stream automatically tracks things like scrolls, outbound clicks, file downloads and site search. Turn off whatever you don’t need. It doesn’t always capture forms reliably—for inquiries, it’s worth setting up a dedicated event.
  5. Test it: Accept tracking in the banner on your website and check the Realtime report to see whether your visit comes through.

Settings You Shouldn’t Overlook

Some default settings in the Admin area deserve a deliberate look:

  • Retention period: Under “Data retention,” you choose how long event data is kept: 2 or 14 months, with 2 as the default. This limits how far back Explorations can go; standard reports aren’t affected.
  • Google signals: This feature uses data from visitors who are signed in to Google and have allowed personalized ads, for example for remarketing. If you don’t need it, keep it off; otherwise it has to be covered in your consent banner and privacy policy.
  • Data sharing: In the account settings, you decide whether Google may use your data beyond your own analytics, for example to improve its products. Only enable what you need.
  • Internal traffic: In the data stream’s tag settings, define your office IP addresses as internal traffic. The corresponding data filter starts out in testing mode and only takes effect once you activate it.
  • Data processing terms: Check in the account settings whether you’ve accepted Google’s data processing terms. They govern how personal data is processed on your behalf.

Measuring Goals: Events and Key Events

Mark the events that matter for your business as key events—that’s what conversions have been called in GA4 since 2024. Typical examples:

  • Inquiry: a successfully submitted form, identified by the thank-you page or the success message.
  • Call click: a click on your phone number—it shows intent, not the actual conversation.
  • Appointment booking: the confirmed booking, not just opening the calendar.
  • Purchase: the completed order, including the order value.

Create custom events in Tag Manager and test them before you rely on the numbers: Preview mode with Tag Assistant shows which tags fire, and DebugView in GA4 shows which events arrive—both with and without consent. Then mark the relevant events as key events; they’re counted from that point on, not retroactively.

Linking Search Console and Google Ads

Under Product links in the Admin area, you connect GA4 to other Google services. Once linked to Google Search Console, GA4 shows which search queries your pages appear for and how often they’re clicked. You then publish the related reports in the Library so they show up in the navigation. This data comes in handy for search engine optimization.

By linking Google Ads, you can import key events as conversions and use GA4 audiences for remarketing—provided you have consent for it. That way you can see which Google Ads campaigns lead to inquiries or purchases.

Google Analytics and the GDPR: Consent and Consent Mode v2

GA4 sets cookies and sends data to Google. That’s why, as a rule, measurement may only start once your visitors have given consent under the GDPR (General Data Protection Regulation, known in Germany as DSGVO). Your consent tool has to control Tag Manager or the Google tag accordingly—more on this in our guide to consent management for WordPress.

Google Consent Mode v2 passes your visitors’ choices on to Google. Four signals are key: whether cookies and similar storage may be used for analytics and for advertising purposes, whether user data may be sent to Google for advertising, and whether ads may be personalized. If you run Google Ads in the European Economic Area, you need these signals for things like remarketing.

With the basic implementation, Google tags only load after consent is given—nothing is sent beforehand. With the advanced implementation, they load before the visitor decides and, if consent is declined, send limited cookieless pings that Google uses to model the missing data. Whether that’s permissible without consent is legally disputed—the basic implementation is the more cautious choice.

Your privacy policy should name Google Analytics, the purpose, the legal basis, the retention period and the possible transfer of data to the US. Since July 2023, that transfer has been covered by the EU-US Data Privacy Framework, under which Google is certified. Whether this framework will hold up in the long run remains to be seen.

Common Mistakes When Setting Up GA4

Things often go wrong right at setup:

  • Tag added twice: The Google tag sits in the theme and also in a plugin or Tag Manager—so pageviews get counted twice.
  • Tracking before consent: A plugin or theme code loads GA4 while bypassing the consent tool. Often you’ll only spot this by looking at your browser’s developer tools.
  • Retention period left at default: If it unintentionally stays at 2 months, Explorations only reach back a short time.
  • No key events: GA4 counts visits but doesn’t show whether they turn into inquiries or purchases.
  • Your own visits aren’t filtered out: Especially on smaller websites, traffic from your own team skews the picture.
  • Mistaking the numbers for actual visitors: Anyone who declines consent or uses an ad blocker is missing from GA4. The figures show trends, not your true visitor count.

Making Good Use of Reports

Pick a few metrics you’ll check regularly—such as users, traffic sources, key pages and key events. Explorations are only worth the effort when you have specific questions, for example about the paths people take before sending an inquiry. For a clear dashboard that colleagues without GA4 know-how can use, try Google’s Looker Studio.

Frequently Asked Questions

Do I need Google Tag Manager for GA4?

No, the Google tag is enough for basic measurement. Tag Manager pays off as soon as you measure custom events, add more ad tags—for example for advertising on Facebook and Instagram—or want to tie everything to consent in one central place. Changes can then be made without touching the theme.

Do I have to anonymize IP addresses in GA4?

No, there’s no longer a setting for that: according to Google, GA4 doesn’t store IP addresses. The IP address is still transmitted when the page loads for technical reasons, though—and that doesn’t change anything about the need for consent.

Can I set up Google Analytics myself, or should I have it done for me?

You can handle the basic setup yourself with this guide. It gets more involved once an online store, Google Ads and Consent Mode v2 come into play. If you’d like someone to set up Google Analytics for you, we’re happy to take care of it as a digital agency based in Berlin—with a dedicated point of contact.

Conclusion

Setting up Google Analytics 4 means more than adding a snippet of code. Only clear goals, deliberately chosen settings, tested key events and measurement that waits for consent give you numbers you can actually work with. And sometimes thinking it through up front shows that cookieless analytics is all you need.

Want your existing GA4 setup reviewed, or to start from scratch? In a free initial consultation by phone or video call, we’ll work out together which approach fits your website.

Note: This guide is for general information only and is no substitute for legal advice.

Marcel Czeranski

Founder and managing director of Marcze Media. He builds WordPress websites, apps, and plugins, as well as digital products of his own: Sponties, Fleißstern, and KakapoWP.

More about us