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 usegtag.js
.
Before you begin
Before you create or modify an event:
- Make sure the name of the custom event is not a reserved name
- Review the changes with your team so you don't duplicate events
- Review the event collection limits
- You need the Editor or Administrator role to modify and create events in Analytics
Instructions
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.
- In the Property column, click Events.
- 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.
- In Custom event name, enter an event name that conforms to the event naming rules.
- 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. - (Optional) Click Copy parameters from the source event to use the parameters from the matching event.
- (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.
- Click Create.
Modifying an event overwrites an existing event by adding, changing, or removing parameters. Modified events are processed before created events are processed.
- In the Property column, click Events.
- 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.
- In Modification name, enter a name that describes the changes.
- 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. - 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.
- Click Create.
Modified events execute in the order they appear in the Event modifications list. Learn more
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:
- In the Property column, click Events.
- 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.
- In the Event modifications pane, click Reorder.
- Drag a modification from one position in the list to another as needed.
- Click Apply.
- In the Property column, click Events.
- 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.
- In the Custom events table, select the event to modify.
- Adjust the conditions and parameters as needed.
- 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
.
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 |
Watch a video
The following videos demonstrate how to create and modify events in Analytics.