How to Set Up Custom Event Tracking in Google Analytics 4

2 views
How to Set Up Custom Event Tracking in Google Analytics 4

In May 2023, companies transitioning from Universal Analytics to Google Analytics 4 (GA4) faced the task of setting up event tracking again. GA4 allows you to create events based on data already collected or send custom parameters through gtag and Google Tag Manager (GTM).

The approaches below come from a guide published in May 2023. Interface section names and platform features are presented as they were at the time.

Which events and parameters does GA4 collect?

The guide lists click, file_download, form_start, form_submit, page_view, scroll, session_start, user_engagement, video_complete, video_progress, video_start and view_search_results as automatically tracked events for websites. Their availability depends on data collection settings.

The parameters GA4 collects by default include page_location, page_referrer, page_title, screen_resolution and language. These may not be enough for more detailed analysis, which is where custom events and parameters can help.

How events work in GA4

When a user takes an action on a website or in an app, GA4 receives a request containing information about that action. In GA4, this data is sent as events; in Universal Analytics, similar requests were called hits. The system then processes and groups the data for reports.

Universal Analytics used four event parameters: Event Category, Event Action, Event Label and Event Value. GA4 does not have this rigid structure: parameters can be chosen to suit the task. This flexibility offers more options for analysis but requires more careful configuration.

Иллюстрация из первоисточника

Creating an event based on another event

One straightforward option requires no programming. In the Events section, select Create Event, then Create, and specify the conditions under which the new event will be created.

Иллюстрация из первоисточника

For example, a newsletter_sign_up event can be created based on page_view if the page_location parameter contains the string newsletter-confirmation. The condition should be adjusted to match the subscription confirmation page URL on the specific website.

In the 2023 setup described in the guide, this event could also be marked as a conversion to count subscriptions. This method works when the desired action can be reliably identified from an event and its parameters that are already being collected.

Custom parameters and gtag

To analyze custom parameters, the guide suggests creating custom definitions in GA4. In the interface shown in April 2023, the path was Admin → Property → Custom definitions. After selecting Create custom dimensions, you needed to enter a definition name and event parameter, and select event scope.

For the example of clicks on the main menu, you can send the category Menu Clicks, the selected link’s URL as event_action and its text as event_label. This data lets you compare clicks on menu items, including when their text changes.

Иллюстрация из первоисточника
Иллюстрация из первоисточника

When using gtag without GTM, a handler on the site must detect a click on a menu link and send an event, such as menu_clicks, along with the three parameters. This implementation requires basic JavaScript skills. The original guide also suggested using ChatGPT to prepare the code; before adding it to the site, check that it matches the menu markup and that the event works.

Additional parameters can also be sent with a predefined event. For example, the guide gives the sign_up event a method parameter with the value Google and a custom sign_up_plan parameter with the value basic. To analyze the additional parameter, you need to create a corresponding custom definition.

Setting up an event through Google Tag Manager

This method in the guide assumes that GA4 is already installed through GTM and that the required custom definitions have been created in GA4. The example applies to menu links inside an element with the class menu-item.

In Variables → User-Defined Variables, create a variable of the Custom JavaScript type. In the implementation described, it gets the clicked element, looks for the nearest parent element with the class menu-item and returns its class attribute. If no matching element is found, the variable returns an empty value. This helps distinguish menu clicks from clicks on other links.

Next, in the Triggers section, create a Click – Just Links trigger with the Some Link Clicks condition: the class of the element found must contain menu-item. In the Tags section, add a GA4 Event tag with a name such as main_menu_clicks and the parameters event_category, event_action and event_label. Use the built-in variables Click URL and Click Text for the link URL and text, respectively.

Иллюстрация из первоисточника

Then attach the trigger you created to the tag. Publish the changes and verify that clicks on menu items trigger the event with the required parameters.

Sending events through dataLayer

If a site uses GTM but it is more convenient to implement click tracking in code, the guide suggests using the dataLayer.push() method. In GTM, the event_category, event_action and event_label parameters must be added as data layer variables.

In the example, a handler on the site tracks clicks on elements with the class menu-item and sends the menu_clicks event, the Menu Clicks category, the link URL and its text to the dataLayer. This approach also requires taking the site’s actual markup into account.

How to verify the setup

Checking that the tag fires in GTM is not enough: a configuration error could prevent the event from reaching GA4. Find the event in DebugView and make sure the expected parameters were sent with it.

For a gtag implementation, the guide suggests enabling debug mode using a Chrome extension or the appropriate GA4 configuration setting. Check both the event itself and the values of all custom parameters.

The benefits of flexible configuration

GA4 takes more time to learn and configure than the ready-made event structure in Universal Analytics, but it lets you collect data tailored to specific needs. The guide also notes that a custom definition can be used to store the source of the first visit as a partial way to address changes in attribution models.

Source: https://www.searchenginejournal.com/google-analytics-event-tracking/484607/

Discussion

Sign in or create an account, to join the discussion.

JOIN THE ULTRAS

A Telegram channel with exclusive case studies you won't find on the site and the most hard-hitting market insights.

SUBSCRIBE ON TELEGRAM

Traffic arbitrage made simple — articles, news and case studies


Imagine earning money online simply by directing traffic and getting paid for every successful conversion. No product of your own, no office, no bosses. Sounds like a fairy tale? In fact, it’s traffic arbitrage, and for many, it has already become a steady source of income, bringing in hundreds to thousands of dollars a day. But in this field, knowledge is just as important as practice. Where can you find setups that work? How do you avoid wasting your budget? Where can you learn strategies from the pros?

There’s one answer: read traffic arbitrage articles on Traffic Ultras, a niche media outlet. Here, you can make sense of trends, find proven case studies and learn from mistakes. You’ll also find everything you need to know to get started if you’re just entering the world of traffic arbitrage.

CPA arbitrage – articles everyone should read


Today, CPA arbitrage articles are more than just content: they’re comprehensive guides that can replace courses and consultations. They’re written by active media buyers, tested in practice and cover the full range of arbitrage work: from setting up trackers and collecting analytics to scaling setups and launching large teams.

These articles are packed with practical advice:

  • how to prepare a setup around a news event,
  • how to analyze results and optimize creatives,
  • how to choose the right offer without wasting your budget,
  • which details to pay attention to.

You can also find unique case studies involving Facebook, Google, TikTok, UAC and even native advertising.

Important: if you want to understand how to start earning from traffic arbitrage, start by reading these resources. Our site has a convenient structure and internal links. For example, after reading about launching a campaign on TikTok, you can go to an article on warming up accounts or visit the traffic arbitrage forum to ask questions directly.

A traffic arbitrage blog by practitioners

What makes a traffic arbitrage blog truly valuable? It’s not theory, but hands-on experience, real traffic and concrete numbers. There’s no fluff here — just proven methods and up-to-date approaches. This kind of content lets you do more than read: you can apply what you learn to your own work. It’s especially useful if you’re already taking your first steps but don’t know how to get the most out of Facebook or properly test push and pop networks.

A modern traffic arbitrage blog is more than just articles; it’s a complete media ecosystem. Traffic Ultras tracks gambling news, trends across verticals and new approaches to creatives, helping our readers stay up to date on the latest strategies.

You can also find partners, frameworks, scripts and even a team through a traffic arbitrage blog. Collaborations emerge in comments and chats, while media buyers share ideas and experience.

Traffic arbitrage – a blog for beginners

If you’re just starting out, a beginner-friendly traffic arbitrage blog is the best way to enter the industry. This kind of content is easy to follow without sacrificing usefulness, covering everything from terminology to launching your first campaign.

A traffic arbitrage blog helps you avoid classic mistakes: wasting your budget on poor pre-landers, ineffective bridge pages and offers that don’t get approved. It explains the mistakes beginners make, how to communicate with CPA network managers and how to avoid getting banned on Facebook with your first campaign. It’s all based on the authors’ real-world experience.

You’ll also find step-by-step instructions, useful checklists and sometimes free templates and trackers. This makes traffic arbitrage blogs especially useful both when you’re starting out and as you grow. They also regularly publish news to help readers keep up with their vertical.

A good traffic arbitrage blog is a guide to the world of traffic that shows: anyone can earn money by taking a systematic, consistent approach.

Questions and Answers

How do you start earning from traffic arbitrage? Articles and blogs to help beginners

If you don't know where to start, check out the CPA arbitrage articles on our site, which explain the basics of arbitrage and how to work with offers and traffic sources in detail. A traffic arbitrage blog can also be a great resource, with experienced media buyers sharing case studies and tips that even beginners can understand.

Which traffic sources are most effective in 2025, according to arbitrage blogs?

An analysis of leading traffic arbitrage blogs reveals several key sources in 2025: TikTok Ads, push traffic, Telegram Ads, and YouTube Shorts. Formats that generate engagement quickly are particularly effective, and traffic arbitrage articles are increasingly focusing on these channels.

Which verticals generate the most revenue, according to traffic arbitrage blogs?

According to authors of popular traffic arbitrage blogs, the most profitable verticals in 2025 are gambling, Nutra, dating, and crypto. An arbitrage blog helps beginners quickly learn the ins and outs of each vertical, including rules for creatives and approaches.

Which arbitrage blog publishes real case studies?

The most valuable resources present each case study as a step-by-step story, from testing to ROI. That's how the Traffic Ultras arbitrage blogs are created: by practitioners who share not only their successes but also their failures, helping readers learn from others' experiences.