You can create and modify events in two ways:
- In code, using Google Tag Manager or APIs such as
gtag.js
or Firebase - In configuration, using Analytics Admin in the left navigation. In the Property column, click Events
This article describes how to modify and create events in Analytics configuration. All events created in Analytics are based on existing website and app events. Common reasons for modifying and creating events include:
- Simplifying reports by using the same event name across properties and data streams
- Fixing a measurement error caused by a typo in an event's name, conditions, or parameters
- Creating a new event (based on an existing event) and trigger it on specific conditions
- Narrowing the scope of an event and mark it as a conversion
Event configuration options
The Admin > Events page in Analytics provides options to work with existing events, which include the automatically collected, enhanced measurement, and recommended events provided by Analytics, and any custom events created by someone in your organization or by a third-party.
Event modification and creation differ as follows:
- Modify event overwrites an existing event. You can add, change, or delete conditions and parameters.
- Create event creates a new event from an existing event. You can copy the existing event's parameters and add new conditions and parameters. You can also edit events created in Analytics from existing events, but you do that from the Create event flow, not the Modify event flow. The Modify an event created in analytics section describes how.
page_view
event to narrow its scope to a particular page, it will no longer collect data from any other pages. If you instead create a new event based on the page_view
event, the original event remains unchanged.To modify or create an event, specify:
- Matching conditions, which include the existing event name and the conditions that will trigger the event. For example, you might want to capture a scrolling event that occurs on a particular web page. In this case, the name of the page would be a matching condition.
- Parameter configuration, which include parameters that Analytics sends automatically and custom parameters that have been added in code or in Analytics. See Set up event parameters for more information.
The Admin > Events and Admin > Conversions pages also provide controls to mark new and existing events as conversions. See Set up and manage conversion events for step-by-step instructions on working with conversions.
Limitations
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 executed client side before data is sent to Analytics for processing.
- Modified events execute in the order they appear in the Event modifications list.
-
Modified events are processed before created events are processed.
-
You can't reorder created events.
-
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 usegtag.js
.
Watch a video
The following videos demonstrate how to create and modify events in Analytics.
Create Events in Google Analytics 4 properties
Edit Events in Google Analytics 4 properties
How to see video captions in your language
The videos above are in English. However, you can use auto captions to translate into your language:
- Begin playing the video.
- To turn on closed captions, click [CC].
- Click
Settings.
- Click Subtitles, then click Auto-translate.
- Select your language.
Create an event
One reason to create a new event from an existing event is to narrow its scope. For example, website visitors trigger the page_view
event when they view any page. You might want to track the visitors who view a specific page separately by creating a new event from the page_view
event and firing it when a visitor views that page.
To create an event in Analytics, first determine which existing event to base it on. Find out what parameters the existing event uses. Finally, choose the conditions that should trigger the new event and decide whether to add parameters to capture additional data.
Event naming rules
To choose a name for your new event, follow these rules:
- Event names are case sensitive. For example,
my_event
andMy_Event
are two distinct events. - Event names must start with a letter. Use only letters, numbers, and underscores. Don't use spaces.
- Event names can include English and non-English words and letters.
-
Do not use reserved prefixes and event names:
Reserved prefixes and event namesThis list is not exhaustive and may be updated periodically. If you try to use a reserved prefix or name, Analytics will display an error message.Web
Prefixes
- _ (underscore)
- firebase_
- ga_
- google_
- gtag.
Event names
- app_remove
- app_store_refund
- app_store_subscription_cancel
- app_store_subscription_convert
- app_store_subscription_renew
- first_open
- first_visit
- in_app_purchase
- session_start
- user_engagement
Mobile (Android and iOS)
Prefixes
- _ (underscore)
- firebase_
- ga_
- google_
- gtag.
Event names
- ad_activeview
- ad_click
- ad_exposure
- ad_query
- ad_reward
- adunit_exposure
- app_background
- app_clear_data
- app_exception
- app_remove
- app_store_refund
- app_store_subscription_cancel
- app_store_subscription_convert
- app_store_subscription_renew
- app_update
- app_upgrade
- dynamic_link_app_open
- dynamic_link_app_update
- dynamic_link_first_open
- error
- firebase_in_app_message_action
- firebase_in_app_message_dismiss
- firebase_in_app_message_impression
- first_open
- first_visit
- in_app_purchase
- notification_dismiss
- notification_foreground
- notification_open
- notification_receive
- notification_send
- os_update
- session_start
- session_start_with_rollout
- user_engagement
Steps to create an event
To create an event from an existing event:
- In the left navigation, click Admin.
- In the Property column, click Events.
- Click Create event.
- If your property has more than one data stream, you will be asked to select a data stream.
- Click Create.
- For Custom event name, enter a name for the new event that conforms to Event naming rules.
- In the Matching conditions Value field, enter the name of the existing event that this event will be based on.
- Click Add condition to specify what will trigger the new event.
- Select the Copy parameters from the source event checkbox to use the same parameters as the original event. For example, if you want your new event to be triggered when a
page_view
event is sent, and you want your new event to have the same parameters aspage_view
, select this checkbox. - If you are copying parameters from the source event, specify any changes you want to make to the parameter values. For example, if your new event is triggered whenever a
page_view
event is sent withpage_title
of "Confirmation", and you want the new event to substitute a different value forpage_title
, specify that change here.
The Examples section illustrates how to specify Matching conditions and Parameter configuration for common use cases.
Modify an event
Modifying an existing event overwrites that event. Use caution when modifying an event someone else provided. Before modifying an event, determine which parameters the existing event uses and decide how you want to modify the event.
- Modify an existing event
- Reorder modifications (to existing events)
- Modify an event created in Analytics
Modification steps
Follow these steps to modify an existing event:- In the left navigation, click Admin.
- In the Property column, click Events.
- Click Modify event.
- If your property has more than one data stream, you will be asked to select a data stream.
- Click Create.
- For Modification name, enter a unique description of the change you are making, such as "Rename pub_article to publish_article".
The Modification name will appear in your list of event modifications, so provide descriptive text. For example, you might need to reorder the sequence of modified events; the name can include which event the modified event depends on to make it easier to reorder them.
- For the Matching conditions Value field, enter the name of the existing event to modify.
- To enter additional conditions to trigger the modified event, click Add condition.
- Under Modify parameters, specify what change should be made. For example, the following specifies that event name should be changed to "publish_article". More examples
Modify parameters
Parameter New value event_name publish_article - Click Save.
Reorder event modifications
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.
To reorder event modifications:
- In the left navigation, click Admin.
- In the Property column, click Events.
- Click Modify Event.
- If your property has more than one data stream, you will be asked to select a data stream.
- In the Event modifications pane, click Reorder.
- Drag a modification from one position in the list to another as needed.
- Click Apply.
Modify an event created in Analytics
To modify an event created in Analytics, follow these steps:- In the left navigation, click Admin.
- In the Property column, click Events.
- Click Create event.
- From the Custom events table, select the event to modify.
- Roll your cursor over the Configuration pane and click the edit icon.
- Adjust the conditions and parameters as needed.
- Click Save.
Examples
Rename an existing event
The example below 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
.
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
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.
- Enter "large_purchase" as the Custom event name.
- Enter the matching conditions.
- 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:
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.
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.
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.
Parameter | New value |
lvl_name |