Shopify and GA4 - Reporting Product Brand to Analytics as part of purchase event

Hi have GA4 working successfully with a shopify store, so it reports the product name and price properly to GA4. In Universal Analytics for this website, I can see stats for products sales by brand, and product sales by category. In GA4 I can only see price per purchase, total amount sold, and that sort of thing - no mention of product brand or category. I have a script embedded in my checkout in shopify in the ‘Order status page’ section, which is working, it just isn’t reporting all the data to GA4 that my client wants. See script at the bottom of this post.

Judging from this script, I need to add two lines towards the bottom below the line that starts with item_id, namely:

item_brand: “{{some shopify variable here }}”,

item_category: "{{some shopify variable here }},

But what’s the shopify variable called? item_id uses line_item.product_id, but I can’t see any equivalent like line_item.product_brand in the help docs.

Am I thinking about this the right way? Not currently using tag manager, for what it’s worth.


Here’s the current checkout script: