This article is about Google Analytics 4 properties. Refer to the Universal Analytics section if you're still using a Universal Analytics property, which will stop processing data on July 1, 2023 (July 1, 2024 for Analytics 360 properties).

[GA4] Modify and create events in Analytics

Change existing events and create new events from existing events without updating your site or app

This article describes how to modify and create events in Google Analytics. All events created or modified in Analytics are based on existing website or app events.

Why modify and create events in Analytics

By modifying or creating events within Google Analytics, you can:

  • Simplify reports by using the same event name across properties and data streams
  • Fix a measurement error caused by a typo in an event's name, conditions, or parameters
  • Create a new event based on an existing event and then trigger it on specific conditions
  • Narrow the scope of an event and then mark the event as a conversion

Limits & caveats

Events configured in Analytics have the following limitations:

  • Modified and created events do not apply to historical data.
  • 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 create and modify custom events based on parameters from the items array (e.g., item_brand, item_name, item_id) when you use gtag.js.

Before you begin

Before you create or modify an event:

Instructions

Create an event from an existing event

Creating an event copies over an existing event into a new event with the parameters from the existing event plus any new parameters you specify.

  1. In the Property column, click Events.
  2. Click Create event, then click Create.
    Important: If you don't see the Create event button in the top right of the table, then you don't have the Editor or Administrator role, which is required to create and modify events.
  3. In Custom event name, enter an event name that conforms to the event naming rules.
  4. In Matching conditions, specify one or more matching conditions. Google Analytics will copy over any event that matches the conditions you specify. For example, if you specify "event_name equals view_item", Analytics will copy over view_item to your new event.
    To define a condition to be case sensitive, use one of the operators that does not include the text "(ignore case)". For example, use "equals" instead of "equals (ignore case)" if you want the parameter to exactly match the value.
    Before you use a regular expression in a matching condition, review the best practices.
  5. (Optional) Click Copy parameters from the source event to use the parameters from the matching event.
  6. (Optional) In Modify parameters, change any of the parameters from the matching event that you've copied over to the new event. For example, if you specify the view_item event in matching conditions, then you could modify the currency parameter. Learn more
    Note: You cannot apply mathematical operations to events using the event builder. Instead, you need to send the updated value in a new event.
  7. Click Create.
Modify an existing event

Modifying an event overwrites an existing event by adding, changing, or removing parameters. Modified events are processed before created events are processed.

Warning: Be cautious about modifying events as it could result in unintended consequences. For example, 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. In this example, you should instead create a new event based on the page_view event so the original event remains unchanged.
  1. In the Property column, click Events.
  2. Click Modify event, then click Create.
    Important: If you don't see the Modify event button in the top right of the table, then you don't have the Editor or Administrator role, which is required to create and modify events.
  3. In Modification name, enter a name that describes the changes.
  4. In Matching conditions, specify one or more matching conditions. You will be able to modify the event that has one or more event parameter that match all the conditions you specify. For example, if you specify "event_name equals view_item", you will be able to modify the view_item event.
    To define a condition to be case sensitive, use one of the operators that does not include the text "(ignore case)". For example, use "equals" instead of "equals (ignore case)" if you want the parameter to exactly match the value.
    Before you use a regular expression in a matching condition, review the best practices.
  5. In Modify parameters, change any of the parameter from the matching event. Learn more
    Note: You cannot apply mathematical operations to events using the event builder. Instead, you need to send the updated value in a new event.
  6. Click Create.

Modified events execute in the order they appear in the Event modifications list. Learn more

Reorder your modified events

Event modifications are applied to your data in the order they appear in the modifications list. This order can be important if you have modifications that rely on each other.

For example, if you rename an event in Modification 1 and use that new name as the basis for creating another event in Modification 2, then you need the modifications to execute in the order of Modification 1 > Modification 2. If those modifications are listed out of order, then Modification 2 will fail.

Note: You can't reorder created events.

To reorder event modifications:

  1. In the Property column, click Events.
  2. Click Modify event.
    Important: If you don't see the Modify event button in the top right of the table, then you don't have the Editor or Administrator role, which is required to create and modify events.
  3. In the Event modifications pane, click Reorder.
  4. Drag a modification from one position in the list to another as needed.
  5. Click Apply.
Edit an event created in Analytics
  1. In the Property column, click Events.
  2. Click Create event.
    Important: If you don't see the Create event button in the top right of the table, then you don't have the Editor or Administrator role, which is required to create and modify events.
  3. In the Custom events table, select the event to modify.
  4. Adjust the conditions and parameters as needed.
  5. Click Save.

Examples

Rename an existing event

The following example shows how to rename pub_article to publish_article. For all data collected after this change, publish_article will appear in reports instead of pub_article.

Warning: If you rename an event that is already marked as a conversion, that event will no longer be a conversion. If you modify event parameters but do not change the name, the event remains a conversion.

Modify event

Modification name

Change pub_article to publish_article

Matching conditions
Parameter Operator Value
event_name equals pub_article

Modify parameters
Parameter New value
event_name publish_article

Create an event from an existing event

Create a new event when you need to trigger an event based on conditions, but you don't want any existing events to change.

For example, suppose the existing article_scroll event is triggered when a visitor scrolls to read a complete article on a website. To have separate reporting on scrolls of the product page (product.html), you could create a new product_scroll event. Both article_scroll and product_scroll will appear in reports, for all data collected after the new event triggers.

Create event

Custom event name

product_scroll

Matching conditions
Parameter Operator Value
event_name equals article_scroll
page_location Contains (Ignore case) product

Trigger an event based on a value

Identify the existing event or parameter you want to use as the trigger for your new event.

Let's say you want to create a custom event called "large_purchase" whenever a purchase event is sent with a value of $100 or more.

  1. Enter "large_purchase" as the Custom event name.
  2. Enter the matching conditions.
  3. Copy the original event's parameters to the new event.

Custom event name

large_purchase

Matching conditions
Parameter Operator Value
event_name equals purchase
value greater than or equal to 100

Parameter configuration

Copy parameters from the source event

In this example, the original purchase event remains, and your new "large_purchase" event is also logged when the value of the purchase event is greater than or equal to 100.

Modify parameters

Open an event as described in Modification steps or Modify an event created in Analytics to change, copy, or remove event parameter values:

Change a parameter value

To change an event parameter value, select the parameter in the Parameter field, then enter the value you want to use in the New value field. For example, to change the value of level_name to "Scary dungeon", select the level_name parameter, then enter the new value:

Modify parameters
Parameter New value
level_name Scary dungeon

Copy a parameter value

You can replace one parameter's value with another parameter's value. To do this, enter the other parameter's name enclosed in double brackets in the New value field.

Modify parameters
Parameter New value
level_name [[other_parameter]]

For example, suppose you find a typo in a parameter name: instead of level_name, an event was implemented with a lvl_name parameter. You can fix this by first copying the misspelled parameter to the correct parameter.

Modify parameters
Parameter New value
level_name

[[lvl_name]]

Note: To use this feature, don't add text outside of the square brackets (for example, "[[lvl_name]] other text" won't work).

Remove an event parameter

You can delete parameters you don't need or want. To do this, set the parameter value to blank.

Modify parameters
Parameter New value
lvl_name  

Watch a video

The following videos demonstrate how to create and modify events in Analytics.

The left navigation in Analytics has been updated since these videos were created. Follow the steps described on this page instead.

Create Events in Google Analytics 4 properties

Edit Events in Google Analytics 4 properties

Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue

Search
Clear search
Close search
Google apps
Main menu
false
Search Help Center
true
true
true
true
true
69256