[null,null,["最后更新时间 (UTC):2023-10-27。"],[[["\u003cp\u003eEcommerce events in Google Analytics 4 allow you to track and analyze user shopping behavior, including product popularity and the impact of promotions.\u003c/p\u003e\n"],["\u003cp\u003eThis guide details how to implement various ecommerce events, such as viewing items, adding to cart, initiating checkout, and making purchases, using an \u003ccode\u003eitems\u003c/code\u003e array to represent products.\u003c/p\u003e\n"],["\u003cp\u003eEach ecommerce event requires specific parameters outlined in the Events reference provided for accurate data collection and analysis.\u003c/p\u003e\n"],["\u003cp\u003eYou can track internal promotions using \u003ccode\u003eview_promotion\u003c/code\u003e and \u003ccode\u003eselect_promotion\u003c/code\u003e events to measure impressions and clicks, respectively.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure accurate revenue calculation, always set the \u003ccode\u003ecurrency\u003c/code\u003e parameter when sending \u003ccode\u003evalue\u003c/code\u003e (revenue) data with your ecommerce events.\u003c/p\u003e\n"]]],["Ecommerce events track user shopping behavior, quantifying popular products and promotion impacts. Key actions to measure include: selecting items, viewing details, adding/removing from carts, initiating checkout, making purchases/refunds, and applying promotions. These actions use an `items` array, representing products with up to 27 custom parameters. Specific events like `view_item_list`, `select_item`, `add_to_cart`, `begin_checkout`, `purchase`, and `refund`, along with promotion events, track these user interactions.\n"],null,["# Measure ecommerce\n\nYou can set up ecommerce events to collect information about the shopping\nbehavior of your users. The events enable you to quantify your most popular\nproducts and see the influence of promotions and product placement on revenue.\n\nThis document describes each ecommerce event and when to set up the event. For a\nstep-by-step example of how to set up an ecommerce event, see [Set up a purchase\nevent](/analytics/devguides/collection/ga4/set-up-ecommerce).\n| **Got 3 mins?** Help us improve the Google Analytics ecommerce documentation by taking [a quick online survey](https://forms.gle/tVx6iijCWP2zWyUU9).\n\ngtag.js Tag Manager\n\nBefore you begin\n----------------\n\nRecommendations\n---------------\n\n- [Enable debug mode](https://support.google.com/analytics/answer/7201382) so you can see events in realtime and troubleshoot issues.\n- Review [the custom dimension and metric limits](https://support.google.com/analytics/answer/10075209#limits) when sending custom parameters with ecommerce events.\n- Set `currency` when sending `value` (revenue) data to ensure revenue metrics are calculated correctly.\n- Set each ecommerce parameter you have data for, regardless of whether the parameter is optional.\n- Use [the sample ecommerce website](https://enhancedecommerce.appspot.com/) to see an example of how to tag your website.\n- To ensure data populates properly in reports, follow the format in this document. If you need to set the items array outside of the ecommerce array, set the `currency` parameter at the event level when you send `value` (revenue) data.\n\nImplementation\n--------------\n\nA typical ecommerce implementation measures any of the following actions:\n\n- [Select an item from a list](#select_an_item_from_a_list)\n- [View item details](#view_item_details)\n- [Add/remove a product from a shopping cart](#add_or_remove_an_item_from_a_shopping_cart)\n- [Initiate the checkout process](#initiate_the_checkout_process)\n- [Make purchases or refunds](#make_a_purchase_or_issue_a_refund)\n- [Apply promotions](#apply_promotions)\n\nAt the heart of these actions are the products and services you sell. You can\nrepresent products and services as an array of items that can be added to\necommerce events. You can include up to 27 custom parameters in the items array,\nin addition to the prescribed parameters.\n\nThe following example demonstrates how to create the collection of `items` that\nare referenced throughout this guide. The `items` array can include up to 200\nelements.\n\nSelect an item from a list\n--------------------------\n\nWhen a user is presented with a list of results, send a `view_item_list` event\nincluding an `items` array parameter containing the displayed items. For details\non the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_item_list).\n\nOnce a user selects an item from the list, send the `select_item` event with the\nselected item in an `items` array parameter. For details on the parameters to\nsend, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#select_item).\n\nView item details\n-----------------\n\nTo measure how many times item details are viewed, send a `view_item` event\nwhenever a user views an item's details screen. For details on the parameters to\nsend, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_item).\n\nAdd or remove an item from a shopping cart\n------------------------------------------\n\nMeasure an item being added to a shopping cart by sending an `add_to_cart` event\nwith the relevant items in an `items` array. For details on the parameters to\nsend, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_cart).\n\nYou can also measure when an item is added to a wishlist by sending an\n`add_to_wishlist` event with the relevant items in an `items` array. For details\non the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_wishlist).\n\nWhen a user subsequently views the cart, send the `view_cart` event with all\nitems in the cart. For details on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_cart).\n\nTo measure when a user removes an item from a cart, send the `remove_from_cart`\nevent. For details on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#remove_from_cart).\n\nInitiate the checkout process\n-----------------------------\n\nMeasure the first step in a checkout process by sending a `begin_checkout` event\nwith one or more items defined with the relevant fields. A coupon can also be\nadded at this stage to the entire order by adding it to the event or applied to\na particular item by adding it to specific elements in the `items` array. For\ndetails on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#begin_checkout).\n\nWhen a user proceeds to the next step in the checkout process and adds shipping\ninformation, send an `add_shipping_info` event. Use the parameter\n`shipping_tier` to specify the user's delivery option, such as \"Ground\", \"Air\",\nor \"Next-day\". For details on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_shipping_info).\n\nSend the `add_payment_info` event when a user submits their payment information.\nIf applicable, include `payment_type` with this event for the chosen method of\npayment. For details on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_payment_info).\n\nMake a purchase or issue a refund\n---------------------------------\n\nMeasure a purchase by sending a `purchase` event with one or more items defined\nwith the relevant fields. For details on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#purchase).\n| **Note:** The `purchase` event replaces ecommerce_purchase and is different from the in_app_purchase event, which is reported automatically.\n\nMeasure refunds by sending a `refund` event with the relevant `transaction_id`\nspecified and one or more items defined with `item_id` and `quantity`. We\nrecommend that you include item information in your `refund` event to see\nitem-level refund metrics in Analytics.\n\nFor details on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#refund).\n| **Note:** The refund event replaces `ecommerce_refund`.\n\nApply promotions\n----------------\n\nEcommerce includes support for measuring impressions and clicks of internal\npromotions, such as banners displayed to promote a sale.\n\nPromotion impressions are typically measured with the initial screen view by\nsending the `view_promotion` event with an items parameter to specify the\npromoted item. For details on the parameters to send, see the [Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_promotion).\n\nTo indicate a user clicked on a promotion, send a `select_promotion` event with\nthat item as an item parameter. For details on the parameters to send, see the\n[Events\nreference](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#select_promotion)."]]