designwithfocus

Website metrics & analytics

How to Create GA4 Events, Recommended and Custom

By Design With Focus Team 6 min read
A GA4 event name field beside a short gtag event call

Short answer

Create a GA4 event either in Admin, by copying an event you already collect, or in code with gtag('event', name) below the Google tag. Use a recommended name such as login or purchase when it matches the action, and invent a custom name only when none fits. Names must stay within 40 characters. Marking that event as a key event is a later, separate step.

Last verified against the sources listed below.

Key takeaways

  • GA4 groups events as automatic, enhanced measurement, recommended, and custom.
  • A custom event needs a name and, when you have extra detail, parameters.
  • Event names are limited to 40 characters and must start with a letter.
  • You can create up to 50 events in Admin from events you already collect.
  • Admin changes do not rewrite history, and they can take an hour or more.
  • A web stream has no cap on distinctly named events. An app user is capped at 500.

How to create GA4 events starts with a check, not a new name. Google already collects some interactions, recommends names for others, and leaves a custom name for the rest. Creating one means either sending that name from the page or deriving it in Admin from an event you already send.

Web analytics is the report those events feed. This guide stops at creating the event.

A key event, which is what you mark when a name should count as a conversion, is explained in key events in GA4. Marking is a later step.

What you need

You need a Google Analytics property, a web data stream, and the Google tag on the site. The setup guide assumes you can edit the page and that you have the Editor role, or higher, on the account. Admin creation uses that role. A call to gtag uses the tag you already installed.

Count the name before you save it. A word counter is a rough check on a parameter label. The real cap is characters, and the limits page sets those numbers.

The tag snippet in Google’s example loads gtag/js from googletagmanager.com and then calls gtag('config', ...). Anything you send has to come after that config. The property itself opens in Google Analytics.

Use a name Google already defined

The setup guide sorts events into four groups. Automatically collected events, such as first_visit, session_start, and user_engagement, need no setup. Enhanced measurement events, such as scroll, click, and file_download, are collected when that toggle is on.

Recommended events need you to send them. Custom events are the ones you name.

The recommended list for every property includes login, sign_up, generate_lead, purchase, search, and share. Online sales adds add_to_cart, begin_checkout, view_item, and view_item_list, which fill the ecommerce purchases report when you send them with the parameters the event docs prescribe.

The custom event page says to look at that list first. A name you invent will not fill those built-in reports. donate is the page’s example of a custom name, used when you are counting donations and no recommended event matches.

Naming rules: start with a letter, use only letters, numbers, and underscores, and do not use spaces. Names are case sensitive, and a reserved name is off limits. The reserved list includes page_view, session_start, click, and scroll.

The naming page says you may reuse an automatically collected name when you create or modify an event inside Analytics. A fresh custom hit from the tag should not borrow one.

Create an event in Admin

This path does not add a tag. It copies an event the property already receives. You need Editor access. If Create event is missing, the help page says the role is too low.

  1. In Admin, under Data display, open Events.
  2. Click Create event, then Create.
  3. Enter a custom event name that follows the naming rules.
  4. Add a matching condition, such as event_name equals page_view, plus a page test if you need one.
  5. Leave “Copy parameters from the source event” on when the new event should keep the original parameters.
  6. Optionally change a copied parameter. You cannot do math in this builder.
  7. Click Create, then wait at least an hour before you judge reports.

The help page’s own example creates confirm_signup when page_view fires on a confirmation URL, and large_purchase when purchase arrives with value greater than or equal to 100. The original event remains. The new one is additional.

Modifying an event is a different button. It overwrites the event that matches, and modified events run before created ones. Renaming a key event clears that key-event mark.

You can store 50 modifications and 50 created events. Neither rewrites data you already collected.

Send an event with gtag

Use this path when the interaction is not already an event. The call shape in the setup guide is gtag('event', '<event_name>', { parameters }). Place it below the Google tag. Google does not process a call that sits above the snippet.

  1. Open the page template that should fire the event.
  2. Find the Google tag snippet and confirm the config call is present.
  3. Add the gtag('event', ...) call under that snippet, or inside the function that handles the action.
  4. Prefer a recommended name, such as login with a method parameter, when the list has one.
  5. For a custom case, send a name such as signup_newsletter with only the parameters you need.
  6. Load the page and look at Realtime. Use DebugView after you enable it.

The guide’s login example sends method: 'Email'. Its share example sends method, content_type, and item_id. Each action is its own call. There is no batch method in that page’s gtag examples.

Parameter limits, from the collection page: 25 parameters per event, 40 characters in a parameter name, 100 characters in a typical value. page_title may be 300, page_referrer 420, and page_location 1,000. Web data streams have no limit on how many distinct event names you collect. App streams are limited to 500 distinctly named events per app user, and automatic plus enhanced events do not count toward that 500.

When the event does not show up

Check role, order, and length before you add another tag.

What you see What the docs point to What to do
Realtime never shows the event The call is above the Google tag, or the tag is missing Move the call below the snippet and reload
The name is dropped The name is longer than 40 characters Shorten it. A key event also needs room for a suffix
A parameter is missing 25 parameters, or a name or value over its cap Remove the extra field or shorten the text
Admin changes skip old dates Created and modified events ignore history Read only data collected after the change
Create event is not on the page The account role is below Editor Ask for Editor on the property
A renamed key event stopped counting Renaming removes the key-event mark Mark the new name again after it appears

The 40-character note on key events is narrow. The limits page says that if a key event’s name is too long, the extra _c Google appends will not fit, and the event will not be reported as a key event. Keep the name short before you mark it. The mark itself is the other guide.

Frequently asked questions

What is the difference between a recommended event and a custom one?

Google's setup guide puts recommended events in a standard list for a kind of business, such as purchase, login, and sign_up. You still have to send them. They are not collected for you. A custom event is a name you define because no automatic, enhanced, or recommended event fits. The custom event help page says to prefer an existing event, because those names already fill dimensions and metrics in reports. Use a custom name only after you have checked the recommended list for the action you are measuring.

How long can a GA4 event name be?

The collection limits page says Google Analytics does not process an event name with more than 40 characters. Parameter names are capped at 40 characters and typical values at 100, with a longer exception for page_location at 1,000 characters. You can attach 25 event parameters to one event. Names are case sensitive, must start with a letter, and may use only letters, numbers, and underscores. Spaces are not allowed. Different capitals make a second event.

Why did my new Admin event not change last month?

The modify and create page says modified and new events do not apply to historical data. It also says an hour or more can pass before a modification takes effect, and that the change is calculated on the client before the data is sent. If you were hoping to repair a typo in last quarter's reports, this screen will not do that. Collect the corrected event going forward. You can modify up to 50 existing events and create up to 50 events based on existing ones.

Where do I look to see if the event fired?

The setup guide says to use the Realtime and DebugView reports. Both show events as people trigger them. DebugView needs extra configuration before it shows anything, so an empty DebugView is not proof the tag is wrong. Realtime is the quicker check after you load the page or click the control. If the event call sits above the Google tag snippet, the guide says Google will not process it. Move the call below the snippet and try again.

Sources