Using Google Analytics to measure how AR and 3D impacts your shopper behavior is easy and can provide insight into how 3D and AR drive transactions and overall engagement. Adding the GA event to your activation is easy.
Adding an On Click GA even to your levAR Event
On Shopify, had over to your product-template.liquid. In the liquid code, find the levAR custom button.
If you are using the levAR Custom Button add the onclick GA code in the snippet below to the existing Button.
{% else %}
<div class="product-description rte" itemprop="description">
{{ product.description }}
{% if product.metafields.custom_btn['active'] %}
<button id="levar-custom-button" class="btn" onclick="ga('send',{hitType: 'event', eventCategory: 'Custom Button', eventAction: 'click'});">View in My Space</button>
<br/>
{% endif %}
If you are using the levAR 3D toggle or carousel implementation add the onclick GA code to the 3D Toggle.
<button id="levar-debut-button" class="levar-debut-toggle" title="Toggle 3D Model" onclick="ga('send',{hitType: 'event', eventCategory: 'Carousel Button', eventAction: 'click'});">
<button id="levar_mobile_button" class="button btn" onclick="ga('send',{hitType: 'event', eventCategory: 'Carousel Button', eventAction: 'click'});">View in Your Space</button>
Setting Up GA Goals
The next step would be to set up a Goal in Google Analytics. Head into the Admin section, then inside the “View” column, select “Goals”. The category is the string from the respective eventCategory that was added in the last step.