How to Update Google Analytics Category to Use Product Type in List Reports

This will show how to change the category attached to products in Enhanced Ecommerce hits to use the native Shopify product type setting

This article shows how to send your Shopify product type as the enhanced ecommerce category. This requires changes to three places:

  1. elevar-body-end.liquid
  2. elevar-checkout-end.liquid
  3. thank you page script

Step 1: elevar-body-end.liquid changes

Inside of the Admin > Themes > Your Live theme > snippets > navigate to elevar-body-end.liquid.

You will then need to find the instances where we have the collection page URL set as the category that looks like this:

Screen Shot 2019-10-01 at 5.03.15 PM


In total, there are:

- (2) productDetailView instances

- (1) addToCart instance

- (1) collectionImpression instance


It involves changing the area circled in red above to instead be:

 category: product.type,


This will then set your product type as the primary category shown in the product list reports so you can have the full CTR => purchase data for product & product type combinations. 

Here are the 4 placements:

Screen Shot 2019-10-01 at 4.58.41 PM


Screen Shot 2019-10-01 at 4.58.41 PM

Screen Shot 2019-10-01 at 4.58.25 PM

Screen Shot 2019-10-01 at 4.57.59 PM


Step 2: elevar-checkout-end.liquid changes


Now you need to make a similar edit in the elevar-checkout-end.liquid file. Find the 'category' parameter and edit so it's the following:

'category': line_item.product.type


Screen Shot 2019-10-17 at 11.11.46 PM

Step 3: Thank You Page script changes

This should already be set by default to your product type, however you should double check to be certain. In the thank you page dataLayer script look for the following:


Screen Shot 2019-12-16 at 9.03.00 AM


Which should be this:

"category": item.product.product_type


That's it!


Back to Top 🔝


Worried You’re Making Decisions on Data You Can’t Trust?

Check out our blog and discover Shopify Optimization & Analytics Tips from Elevar's data experts.