Modify and create events in GA4
Google Analytics 4 lets you rename events, fix their parameters and build new events from existing ones without touching the site's code. This guide covers the difference between Modify event and Create event, how matching conditions and parameters work, the order they run in, Google's limits, and when a change to the tag is the better fix.
This guide is built from Analytics Help: Rename and generate new events, Modify and generate events using regular expressions, Event naming rules and Event collection limits. Quotes are Google's wording; the sections marked as ours are our own view and practice.
Two tools: modify and create
Both live in Admin, under Data display, Events, and they do different jobs:
- Create event leaves the original event alone and logs an extra one. Google: "Generating an event copies over an existing event into a new event with the parameters from the existing event plus any new parameters you specify."
- Modify event changes the event itself. "Modifying an event overwrites an existing event by adding, changing, or removing parameters." Renaming an event is a modification of its
event_nameparameter.
Google's typical use for Create event is a thank-you page: generate a custom event such as confirm_signup "whenever the page_view event occurs with a page_location parameter value that matches your confirmation page URL", then mark it as a key event. Our key events guide walks through that example with generate_lead, so we don't repeat it here. Modify event is for repairs: Google says it "allows you to fix measurement errors caused by a typo in an event's name, conditions, or parameters."
Both need the Editor role or above on the property. "If you don't see the Create event button in the top right of the table, then you don't have the required role". If the property has more than one data stream, "you will be asked to choose which stream you want to create or modify your events in", so the rules belong to a stream (see our data streams guide).
Limits and caveats
Google lists these before the instructions, and most problems we see come from one of them:
- "Modified and new events do not apply to historical data." A rename fixes reports from the day it goes live, not the months before.
- "You can modify up to 50 existing events and create up to 50 events based on existing events."
- "An hour or more passes before modifications take effect."
- "Modifications are calculated client side (before data is sent to Analytics)."
- "You can't generate or modify events based on parameters from the items array (e.g., item_brand, item_name, item_id) when you use gtag.js."
- "You can't modify events if you send them in a server-to-server setup, for example, when you use Measurement Protocol." See our Measurement Protocol guide for that route.
- "Event names can't be left blank."
New names also have to follow Google's event naming rules: "Event names are case sensitive", they "must start with a letter. Use only letters, numbers, and underscores. Don't use spaces." Reserved names such as session_start or first_visit can't be used for your own events, although Google notes "you can use any automatically collected event names from the list below when you create or modify events". The collection limits still apply to the result: an event name can be at most "40 characters", and an event can carry "25 event parameters".
Creating an event from an existing one
- In Admin, under Data display, click Events.
- Click Create event, then Create.
- In Custom event name, enter a name that follows the naming rules.
- In Matching conditions, add one or more conditions. "Google Analytics will copy over any event that matches the conditions you specify."
- Leave Copy parameters from the source event on (the default) unless you want the new event without them.
- Optionally, change copied parameters under Modify parameters, then click Create.
Google's examples show how conditions combine. To report product-page scrolls separately from article scrolls, it creates product_scroll with two conditions: event_name equals article_scroll, and page_location contains (ignore case) product. "Both article_scroll and product_scroll will appear in reports". In another, a large_purchase event is logged when a purchase event has a value "greater than or equal to 100", while "the original purchase event remains".
Case matters in conditions. Google: "use 'equals' instead of 'equals (ignore case)' if you want the parameter to exactly match the value."
Modifying an existing event
The steps are the same screen with a different button: Admin > Events > Modify event > Create, a Modification name that describes the change, the Matching conditions, the changes under Modify parameters, then Create.
Google's rename example changes pub_article to publish_article: the condition is event_name equals pub_article, and the new value of event_name is publish_article. "For all data collected after this change, publish_article will appear in reports instead of pub_article."
Two warnings from Google are worth reading twice:
- "If you modify the Google-provided page_view event to narrow its scope to a particular page, it will no longer collect data from any other pages." Its advice: "create a new event based on the page_view event so the original event remains unchanged." We treat the automatic events from enhanced measurement the same way.
- "If you rename an event that is already marked as a key event, that event will no longer be a key event. If you modify event parameters but do not change the name, the event remains a key event." After a rename, mark the new name as a key event (see marking an event).
Changing, copying and removing parameters
Under Modify parameters there are three moves, in both tools:
- Set a value: pick the parameter and type the new value, for example
level_nameset to "Scary dungeon". - Copy another parameter's value: "enter the other parameter's name enclosed in double brackets in the New value field", such as
[[lvl_name]]. Google's example uses this to fix a parameter that was implemented aslvl_nameinstead oflevel_name. Nothing else can go in the field: "[[lvl_name]] other text" won't work. - Remove a parameter: "set the parameter value to blank." The exception is the name itself: "event_name parameters can't be blank."
There is no arithmetic. "You cannot apply mathematical operations to events using the event builder. Instead, you need to send the updated value in a new event." So you can't, for example, add tax to a value or convert a currency here. If a parameter needs to show in reports, it still needs a custom dimension after the change.
Order of modifications
"Modified events are processed before created events are processed", and modifications "execute in the order they appear in the Event modifications list." The order matters when one rule depends on another. Google's example: if Modification 1 renames an event and Modification 2 uses the new name, "If those modifications are listed out of order, then Modification 2 will fail."
To change the order: Admin > Events > Modify event, click Reorder in the Event modifications pane, drag the items, and click Apply. To edit a created event later, open Create event, select it in the Custom events table, adjust it and click Save.
Because modifications run first, a created event should match on the name the event has after any renames, not the old one.
Regular expressions in conditions
"For web data streams, you can modify and generate a new event in Google Analytics using a regular expression". Google's advice is to reach for it last: "use other operators where possible (e.g., exact matches, contains)". The reason is where the rules run: "Google Analytics executes Event Creation and Modification rules directly on the browser", and "Complex or poorly written regex can cause significant issues when run in certain browsers, and lead to site breakage and computer crashes." Google asks you to "Avoid unbounded or nested repetitions" and to test the pattern against the values you expect.
When to change the tag instead
This section is our own view. The event tools are a patch on data that is already being sent. They are the right choice for a quick rename, a thank-you-page event on a site you can't edit, or a split of one event into two reports. We fix the source instead, in the site code or in Google Tag Manager, when:
- the value has to be calculated, which the event builder can't do;
- the data comes from the Measurement Protocol or an items array sent with gtag.js, which the tools can't reach;
- the event needs data that isn't in any parameter yet, such as a form name or plan type; that belongs in the data layer;
- the list of rules is growing towards the 50 limit, or rules depend on each other in a chain that is hard to follow.
A fix in the tag also keeps the same event name in every tool that reads the data, while a GA4 rule only changes what GA4 records.
How we use these tools
This part is our own practice, not Google guidance. We create new events rather than modify Google's automatic ones, and keep Modify event for typos and renames. Each rule gets a modification name that says what it does and why, and we keep a short list of all rules in the client's measurement notes. After any change we wait the hour Google mentions, then check the event in DebugView and Realtime, and we re-mark key events after a rename the same day.
Frequently asked questions
What is the difference between Modify event and Create event in GA4?
Modify event overwrites an existing event: it can rename it or add, change or remove parameters. Create event leaves the original alone and logs an extra event whenever an existing event matches your conditions. Google runs modifications before created events.
Do modified or created events change my past data?
No. Google says modified and new events do not apply to historical data, and that an hour or more passes before a change takes effect.
How many events can I modify or create?
Google's limit is up to 50 modified events and up to 50 events created from existing events.
Will a renamed event stay a key event?
No. Google warns that if you rename an event that is already marked as a key event, it will no longer be a key event. Changing only its parameters keeps it a key event.
Can I modify events sent with the Measurement Protocol?
No. Modifications run in the browser before data is sent, so Google says you can't modify events sent server to server, such as through the Measurement Protocol. Fix those in the code that sends them.