DEPRECATED: Instant Analytics brings full Google Analytics support to your Twig templates and automatic Craft Commerce integration with Google Enhanced Ecommerce.
When I use {% do instantAnalytics.addCommerceProductDetailView(product) %} on the product detail page I get the following error after update from Craft 3 to Craft 4:
Undefined array key "sku"
product is an object of craft\commerce\elements\Product not craft\commerce\elements\Variant, so I guess it must be product['defaultSku'] instead of product['sku'] in case a product is passed in.
Describe the bug
When I use
{% do instantAnalytics.addCommerceProductDetailView(product) %}
on the product detail page I get the following error after update from Craft 3 to Craft 4:Undefined array key "sku"
product
is an object ofcraft\commerce\elements\Product
notcraft\commerce\elements\Variant
, so I guess it must beproduct['defaultSku']
instead ofproduct['sku']
in case a product is passed in.Versions