Skip to main content

Set up Google Analytics 4

Set up Google Analytics 4 (GA4) to track events from your storefront. After you set up a Google Analytics 4 property, you can add the GA4 tag to Instacart’s Google Tag Manager container.

Instacart sets up a Google Tag Manager (GTM) container for your storefront and gives one person in your organization write access to the GTM container. This write access does not allow you to publish changes in the GTM containers, but allows you to modify events and tags within the containers. For publishing, you need to contact your Instacart representative. Instacart reviews the changes and either publish the changes or contact you if you need to make changes.

The goal of this topic is to supplement the official Google GA4 setup guide with steps that you need to complete specifically for your storefront.

  1. Create a Google Analytics 4 property.

  2. 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.

  3. Contact your Instacart representative to get access to the GTM container.

  4. 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.

  5. Create Custom Events through GA4 Event Tags.

    Configure event tags for any of the following events that you want sent to your GA4 account:

    EventDescription
    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 loads a product details page.
    store.viewThe storefront was loaded.
    store.loadThe storefront started to load.
    page.viewA customer loads a page on your storefront.
    cart.viewA customer clicked the cart icon to view items in the cart.
  6. Optional. Configure parameters for the event.

    cart.add_item event

    The following table lists the parameters available for the cart.add_item event:

    ParameterTypeDescription
    currencystringThe currency type in ISO 4217 format. For example, USD.
    pricenumberThe price of the item.
    itemNamestringThe name of the item.
    qtyDiffintegerThe item quantity.
    cart.change_quantity event

    The following table lists the parameters available for the cart.change_quantity event:

    ParameterTypeDescription
    currencystringThe currency type in ISO 4217 format. For example, USD.
    pricenumberThe price of the item.
    itemNamestringThe name of the item.
    qtyDiffintegerThe item quantity. If an item is removed, qtyDiff will be negative. If an item is added, qtyDiff will be positive.
    checkout.start event

    The following table lists the parameters available for the checkout.start event:

    ParameterTypeDescription
    service_typestringThe fulfillment type. For example, pickup or delivery.
    checkout.placed_order event

    The following table lists the parameters available for the checkout.placed_order event:

    ParameterTypeDescription
    currencystringThe currency type in ISO 4217 format. For example, USD.
    total_with_feesnumberThe order total, including taxes and fees.
    order_idstringThe order ID for the order.
    order_items[].namestringThe name of the item.
    order_items[].full_pricenumberThe price of the item.
    order_items[].quantitynumberThe item quantity.
    sales_taxnumberThe sales tax for the order.
    shipping_pricenumberThe pick up or delivery fee.
    cart_totalnumberThe total, excluding tax and fees.
    service_typestringThe fulfillment type. For example, pickup or delivery.
    product_details_page.page_view event

    The following table lists the parameters available for the product_details_page.page_view event:

    ParameterTypeDescription
    currencystringThe currency type in ISO 4217 format. For example, USD.
    pricenumberThe monetary value of the event. For example, 30.03.
    item_namestringThe name of the item added to the cart.
    product_category_namestringThe item quantity.
  7. Add variables to capture additional events or user parameters in the GTM events to be sent to GA4.

  8. Contact your Instacart representative to publish your changes to the production site.