Set up Google Analytics 4
To analyze comprehensive insights about the customer journey, use Google Analytics.
Instacart Storefront is an event provider through the data layer and is integrated with Google Tag Manager. During onboarding, you are given access to a Google Tag Manager (GTM) container where you can link your Google Analytics account. You can also define custom events and tags in the Google Tag Manager container, and then test them in preview mode. To publish the customizations to your storefront, contact your Instacart representative.
Then, use your Google Analytics account to track events such as product impressions, click actions, and bounce rate. For more detailed analyses, create funnels and goals that trigger on specific events.
The goal of the following steps is to supplement the official Google GA4 setup guide with steps that you need to complete specifically for your storefront.
-
Create a Google Analytics 4 property.
- If you are setting up Google Analytics for the first time, use the Setup Assistant.
- If you are migrating from Universal Analytics, use the GA4 Setup Assistant.
-
Add a Web data stream. During web data stream creation, a new measurement ID is created, such as
G-*****.Copy the measurement ID. You need the ID for step 4.
-
Contact your Instacart representative to get access to the GTM container.
-
In the GTM container, create a GA4 Configuration Tag and add your GA4 measurement ID (
G-*****) so that data can flow to your GA4 property.At minimum, this tag will need to trigger on every page_view.
-
Create Custom Events through GA4 Event Tags.
Configure event tags for any of the following events that you want sent to your GA4 account:
Event Description cart.add_itemA customer added an item to the cart. cart.change_quantityA customer changed the item quantity, such as by adding or removing items. checkout.startA customer started the checkout process. This event occurs when a customer clicks Continue to checkout on the checkout aisle recommendations page. checkout.placed_orderA customer placed an order. product_details_page.page_viewA customer loaded a product details page. store.viewThe storefront was loaded. store.loadThe storefront started to load. page.viewA customer loaded a page on your storefront. cart.viewA customer clicked the cart icon to view items in the cart. -
(Optional) Configure parameters for the event.
cart.add_item event
The following table lists the parameters available for the
cart.add_itemevent:Parameter Type Description currencystring The currency type in ISO 4217 format. For example, USD.pricenumber The price of the item. itemNamestring The name of the item. qtyDiffinteger The item quantity. cart.change_quantity event
The following table lists the parameters available for the
cart.change_quantityevent:Parameter Type Description currencystring The currency type in ISO 4217 format. For example, USD.pricenumber The price of the item. itemNamestring The name of the item. qtyDiffinteger The item quantity. If an item is removed, qtyDiffwill be negative. If an item is added,qtyDiffwill be positive.checkout.start event
The following table lists the parameters available for the
checkout.startevent:Parameter Type Description service_typestring The fulfillment type. For example, pickupordelivery.checkout.placed_order event
The following table lists the parameters available for the
checkout.placed_orderevent:Parameter Type Description currencystring The currency type in ISO 4217 format. For example, USD.total_with_feesnumber The order total, including taxes and fees. order_idstring The order ID for the order. order_items[].namestring The name of the item. order_items[].full_pricenumber The price of the item. order_items[].quantitynumber The item quantity. sales_taxnumber The sales tax for the order. shipping_pricenumber The pickup or delivery fee. cart_totalnumber The total, excluding tax and fees. service_typestring The fulfillment type. For example, pickupordelivery.product_details_page.page_view event
The following table lists the parameters available for the
product_details_page.page_viewevent:Parameter Type Description currencystring The currency type in ISO 4217 format. For example, USD.pricenumber The monetary value of the event. For example, 30.03.item_namestring The name of the item added to the cart. product_category_namestring The product category name. -
Add variables to capture additional events or user parameters in the GTM events to be sent to GA4.
-
Contact your Instacart representative to publish your changes to the production site.