Back

Comprehensive Guide to GA4 Configuration

In the world of digital analytics, a fundamental rule applies: “garbage in, garbage out.” This means that the quality of business decisions is directly dependent on the quality of the data we rely on. An incorrectly configured analytics platform inevitably leads to gathering inaccurate, incomplete, or outright erroneous information.

Imagine a scenario where traffic from payment gateways isn’t excluded. As a result, the analytics system incorrectly attributes e-commerce conversions to the source ‘PayU / referral’ instead of the Google Ads campaign that actually acquired the customer. This leads to underestimating the ROI of paid ads and, consequently, to a flawed allocation of the marketing budget.

Solid foundations in the form of a correct, thoughtful Google Analytics 4 configuration are absolutely crucial for reliable analysis and sustainable business growth. This guide will take you step-by-step through the entire process – from creating the property to validating conversion tracking – ensuring your data serves as a solid basis for making accurate decisions.

Step 1: How to Create a Property and Data Stream in GA4?

The process begins with creating a new Property in the Google Analytics panel. Each GA4 property can collect data from various sources, such as a website or mobile apps. For each of these sources, we create a so-called Data Stream.

To configure GA4 for a website, follow these steps:

  1. In the Admin panel, create a new Google Analytics 4 property.
  2. Go to the “Data Streams” section and select the “Web” platform.
  3. Enter your website’s URL and name the stream (e.g., “Main Website”).
  4. Ensure the “Enhanced measurement” option is enabled. This is a default setting that allows for the automatic collection of data on key user interactions without additional configuration. It includes events such as:
    • Page scrolls (scroll)
    • Outbound link clicks (click)
    • Site search (view_search_results)
    • Video engagement (video_start, video_progress, video_complete)
    • File downloads (file_download)
  5. After clicking “Create stream“, you will receive a unique “Measurement ID” in the format G-XXXXXXXXXX, which will be necessary for the next steps.

gtag.js or Google Tag Manager? How to Implement the GA4 Tracking Code

There are two main methods for implementing the GA4 tracking code on a website:

  • Global Site Tag (gtag.js): Directly pasting a snippet of JavaScript code into the <head> section of every page on the site.
  • Google Tag Manager (GTM): Implementation via a GTM container, which centralizes the management of all marketing and analytics scripts.

The definitely recommended and standard industry practice is implementation via Google Tag Manager (GTM). It offers incomparably greater flexibility, allowing for the deployment of even very advanced tracking without modifying the website’s code. Choosing GTM is not just a matter of convenience, but a strategic decision regarding scalability and the future of your analytics. It allows for the later, seamless implementation of advanced techniques, such as E-commerce tracking, Client ID, or User ID, without involving developer resources for every modification.

Step 2: Essential Settings in the GA4 Panel (Checklist)

Installing the GA4 tag is just the beginning. To avoid collecting noisy and useless data, it is necessary to immediately configure the fundamental property settings. The steps below constitute the absolute minimum of “analytics hygiene” for any professional implementation.

  • Data Retention: Go to Admin > Data collection and modification > Data retention. By default, user-level and event data are retained for 2 months. It is recommended to change this value to the maximum available period, which is 14 months.
  • Defining Internal Traffic: To avoid data distortion by employee visits, you must configure filters to exclude internal traffic. Go to Admin > Data collection and modification > Data filters. Here you can define rules based on IP addresses to mark traffic as “internal”.
  • List of Unwanted Referrals: Sometimes traffic sources can be incorrectly attributed to external services, such as payment gateways (e.g., PayU, PayPal). To prevent this, in the section Admin > Data Streams > [Your Stream] > Configure tag settings > List unwanted referrals, add the domains that should be ignored as traffic sources.
    Expert Tip: Regularly, at least once a quarter, audit the ‘Referral’ report to identify new domains that may be distorting attribution data.
  • Linking with Google Ads and Search Console: Integration with other Google tools is crucial for a complete marketing picture.
    • Google Ads: In Admin > Product links > Google Ads links, you can link your GA4 property with your ad account. This allows for conversion importing and building remarketing lists.
    • Google Search Console: Linking with GSC (Admin > Product links > Search Console links) will unlock reports in GA4 regarding organic traffic from the Google search engine.

Step 3: Understanding and Configuring Events in GA4

The most important change in Google Analytics 4 is the fundamental shift to an Event-Driven Data Model. In GA4, every user interaction – from a page view, through a button click, to a purchase – is recorded as a separate event. Even a page view is now an event named page_view.

We distinguish four main categories of events:

  1. Custom events: Any event defined by you if none of the standard ones fit.
  2. Automatically collected events: Recorded by default, e.g., session_start, first_visit.
  3. Enhanced measurement events: Activated by the “Enhanced measurement” option, such as scroll, click, or file_download.
  4. Recommended events: Names pre-defined by Google for typical actions (e.g., generate_lead for acquiring a contact, purchase for a purchase).

How to Track Form Submissions in GA4 using GTM

Let’s assume we want to track the submission of a contact form as a recommended event named generate_lead. Here is how to configure it using Google Tag Manager:

Step 1: Create a Trigger

  • In GTM, go to “Triggers” and create a new one.
  • Select the type “Form Submission”.
  • Specify the firing condition so it activates only for the contact form, e.g., “Form ID” equals “contact-form”.

Step 2: Create a Tag

  • Go to “Tags” and create a new tag of the type “Google Analytics: GA4 Event”.
  • In the “Event Name” field, type generate_lead.
  • In the ‘Event Parameters’ section, add additional information, e.g., form_name with the value main_page_contact_form, to distinguish which form generates the leads.
  • In the “Triggering” section, select the trigger created in the previous step.
  • Save and publish the GTM container.

Step 4: Tracking Conversions in GA4 – From Event to Key Event

In Google Analytics 4, a conversion (now often referred to as a “Key Event”) is simply an important event that has been marked as such.

  • Method 1: Marking an existing event: When an event (e.g., generate_lead) appears in reports, go to Admin > Data display > Events and toggle the switch in the “Mark as key event” column.
  • Method 2: Creating a conversion in advance: Go to Admin > Data display > Key events, click “New key event” and type the exact name of the event you plan to implement (e.g., generate_lead). This method is the industry standard because it ensures data is counted correctly from the very beginning.

Step 5: Verification and Testing of GA4 Settings (Audit)

After completing the configuration, verifying the correctness of the implementation is crucial.

  • DebugView: This built-in tool in GA4 (Admin > Data display > DebugView) shows the live stream of events from your device. It is invaluable for checking if newly configured events and their parameters are being sent correctly.
  • Google Tag Assistant and GTM Preview Mode: Before publishing changes in GTM, always use “Preview Mode”. It will open your site with a debug panel showing which tags have fired. Additionally, the Tag Assistant browser extension allows you to verify if the GA4 and GTM tags are correctly installed on the page.

Trending post 🔥

In this article:

Leave a comment

Choose your language