In the "analytics.js" version of Google's Enhanced E-commerce, impression data is passed to Google Analytics using the ec:addImpression command. This was changed in the updated "gtag.js" version. When using the GTAG version of the tag, the "add_to_cart", "remove_from_cart" , "select_content", "view_item" or "view_item_list" events must be triggered in order to pass the product data for an impression. These events are passed to Google through the tag's mappings.

When tracking product impressions, data quality can be improved by limiting the size of the requests sent to Google. The maximum payload length allowed by Google is 8192 bytes, which is easily surpassed if a large number of impressions are sent in a single request (ex: 50 - 60 products). Optimal results can be achieved by sending smaller data sets with each request (ex: 8 - 10 products), which is sufficient for data collection as the products impressed upon a visitor are usually the items above the fold of the webpage.

Setting Up a "view_item_list" Event

1. Trigger the Event

Set a 'view_item_list' event in the mappings. In this example, the event will trigger when the page name equals category.


2. Map Required (and optional) Variables

Per Google's requirements, "impression_id" and "impression_name" are required for this event and will also need to be mapped. These variables should be an array of strings. Other parameters can be passed with this event. The example from Google below shows which parameters can be sent and an example of the value for each variable.

3. Verify Events
Verify your event is sending as expected and that the mapped values are being populated properly by viewing the correct request in the "Network" tab of the developer tools. Click on the correct request and scroll down to see if the correct query string parameters have been populated. 

Version history
Revision #:
15 of 15
Last update:
a month ago
Updated by: