Google Analytics categorizes ecommerce data into event and item scopes.
- The event scope provides information about an ecommerce event, such as the value of an overall transaction.
- The item scope provides information about the items (i.e., the products and services you sell) in an ecommerce event, such as the name or price of an item.
Understand parameter scopes
Ecommerce events are recommended events that you need to define on your website or app to see ecommerce data in Google Analytics. When you define an ecommerce event, you enter event-level parameters and (optionally) item-level parameters.
For example, consider the following gtag.js code:
The purchase event has a number of event-scoped parameters, such transaction_id
, value
, and tax
. These parameters provide information about the purchase. Included in the event is an items
array, which provides information about the event as well; specifically, the items
array describes the purchased items.
When the same parameter appears twice
Some parameters can be defined at both the item and event level. For example, the creative_name
parameter in the select_promotion
event can be defined at both levels. Depending on the parameter, Analytics either overrides the event-scoped parameter value with the item-scoped parameter value or collects both parameter values.
Analytics allows you to define parameters at both levels so you can more accurately connect to current user activity that leads to later user activity.
For example, you can set the item_list_id
parameter in the view_item_list
event at both levels. When you set the parameter in the event, the parameter identifies the current list that the customer is interacting with. As a customer continues to interact with your website, you want to connect to the original list as being responsible for a later purchase.
When you set the following parameters at the event and item level, the parameters at both levels are used:
coupon
When you set the following parameters at the event and item level, the item level takes precedence:
creative_name
creative_slot
item_list_id
item_list_name
promotion_id
promotion_name
To learn more about the behavior of event parameters, see the Events reference.