E-commerce transactions are crucial for any online store, and tracking these transactions using Microsoft Clarity can provide valuable insights. This guide explains how to set up e-commerce and purchase tracking in Microsoft Clarity.
Importance of Tracking Purchases
Tracking purchases allows you to:
- Segment sessions with and without purchases.
- Investigate user experience and identify friction points.
- Provide more context to Microsoft Clarity's AI insights.
Tracking Purchases in Microsoft Clarity
While the "E-commerce Insights" feature is available for Shopify-integrated Clarity projects, other e-commerce actions can still be tracked manually.
Manual E-commerce & Transaction Tracking
Using Smart Events
- Auto Events: Automatically track actions but may not accurately represent successful transactions.
- API Events: Recommended for accurate tracking of successful purchases.
<script>
window.clarity("event", "purchase");
</script>
This can be implemented using Google Tag Manager or Piwik Pro Tag Manager.
Identifying Trackable Actions
Trackable actions include:
- Viewing an item
- Adding to cart
- Viewing the cart
- Beginning checkout
- Adding payment information
- Adding shipping details
- Completing a purchase
Customizing Event Tracking Code
Adjust the event name for specific e-commerce actions.
<script>
window.clarity("event", "{{e-commerce action}}");
</script>
Using Custom Tags
Custom Tags add valuable context to the data collected.
<script>
clarity("set", "transactionID", "{{your order ID}}");
</script>
Examples of Custom Tags:
- PageType: Enhance content grouping.
- PurchaseQTY: Track product quantity.
- CustomerType: Differentiate between first-time and returning customers.
- AppliesCouponCode: Track coupon usage.
- SpendCategory: Segment transactions by spending range.
- ConversionType: Identify specific e-commerce actions.
Utilizing Collected E-commerce Data
- Create filters using Smart Events and Custom Tags.
- Save filters as segments for easy reference.
- Use e-commerce data with Microsoft error tracking to identify JavaScript errors during purchases.
Shopify Integration
For Shopify users, the native integration tracks purchases and provides detailed e-commerce insights, such as Checkout Abandonment reports.
Closing Remarks
Track e-commerce actions and critical checkout errors to understand their impact on revenue and conversions. Manual setup of e-commerce tracking is recommended, as well as over-relying on Auto Events.