Advanced Shopify + Matomo Tracking Guide

By JoeVu, at: 14:15 Ngày 11 tháng 12 năm 2024

Thời gian đọc ước tính: 5 min read

Advanced Shopify + Matomo Tracking Guide
Advanced Shopify + Matomo Tracking Guide

Advanced Shopify + Matomo Tracking Guide


While Matomo’s official guides already cover the basics of integrating Shopify with Matomo for general tracking and ecommerce events, there are additional advanced configurations and optimizations you can implement to make your tracking even more valuable. Below, we’ll provide official guide links and dive into some recommendations for refining your Matomo tracking setup for Shopify.


Official Integration Guides

  1. How to Install Matomo Tracking Code on Shopify

    Matomo Shopify Tracking Code Guide

    Learn how to embed Matomo’s tracking code on your Shopify store using Custom Pixels.
     

  2. How to Track Shopify Ecommerce Events with Matomo

    Matomo Shopify Ecommerce Events Guide

    Get detailed instructions to track Shopify ecommerce events, including purchases, add-to-cart actions, and more.
     


Advanced Recommendations

To go beyond basic tracking and get the most out of your Matomo integration, consider these advanced tips:

 

1. Track Shopify Client IDs


By tracking unique Shopify Client IDs, you can link customer sessions across multiple devices and provide a better understanding of user behavior.

How to Implement:

Use the Shopify client ID in your tracking code to enrich your Matomo analytics data. Add a custom dimension in Matomo to store the client ID and link it to Shopify user sessions.

// Example to capture Shopify Client ID
_paq.push(['setCustomDimension', customDimensionId, ShopifyAnalytics.meta.clientId]);

 

Benefit:

  • Gain deeper insights into customer behavior.
     
  • Track returning users more effectively across devices.

 

2. Avoid Tracking Google Ads and Referral Parameters


Unnecessary tracking parameters like utm_* or fb_* can clutter your analytics and make reports harder to read. Use Matomo’s setExcludedQueryParams and setExcludedReferrers features to clean up your tracking data.

 

Exclude Unwanted Parameters:

Add the following snippet to your tracking code to exclude marketing parameters and certain payment/referral sources:

_paq.push(["setExcludedQueryParams", [ "/^utm.*/", "/^mtm.*/", "/^fb.*/", "/^gc.*/", "/^ms.*/", "/^tt.*/", "/^tw.*/", "/^li.*/", "/^sc.*/", "/^pin.*/", "/^rd.*/", "/^yc.*/", "/^dc.*/", "/^cid$/", "/^icid$/" ]]);

_paq.push(["setExcludedReferrers", [ "shopify.com", ".mybigcommerce.com", ".shopify.com", "paypal.com", ".paypal.com", "applepay.com", ".applepay.com", "stripe.com", ".stripe.com", "squareup.com", ".squareup.com", "klarna.com", ".klarna.com", "afterpay.com", ".afterpay.com", "pay.google.com", ".pay.google.com", "pay.amazon.com", ".pay.amazon.com", "shop.app", ".shop.app", "authorize.net", ".authorize.net", "braintreepayments.com", ".braintreepayments.com", "worldpay.com", ".worldpay.com", "adyen.com", ".adyen.com", "2checkout.com", ".2checkout.com", "skrill.com", ".skrill.com", "wepay.com", ".wepay.com", "bluesnap.com", ".bluesnap.com", "sezzle.com", ".sezzle.com", "affirm.com", ".affirm.com", "payments.bigcommerce.com" ]]);

 

Benefit:

  • Cleaner analytics data without irrelevant parameters.
     
  • More accurate referral reports and better insights into traffic sources.

 

3. Improve Data Collection with Custom Dimensions


Use Matomo’s custom dimensions to capture additional metadata, such as:

  • User Type: New vs. returning customers.
     
  • Shopify Tags: Track specific tags or customer attributes for segmentation.
     
  • Purchase Categories: Segment purchases by product type or category.
     

How to Add a Custom Dimension:

  1. Go to Matomo Admin > Custom Dimensions and create a new dimension.
     
  2. Modify your Shopify tracking code to include the custom dimension. Example:
 
_paq.push(['setCustomDimension', customDimensionId, 'CustomerType: Returning']);

 

 

4. Regularly Audit Your Tracking Setup


Over time, your Shopify store evolves with new features, themes, or apps. Periodically audit your Matomo tracking to ensure it captures all relevant data accurately. Key points to review:

  • Check if custom events are firing as expected.
     
  • Validate ecommerce data, including item details and pricing.
     
  • Ensure new site elements or apps are properly tracked.

 

Conclusion


By combining the official Matomo guides with these advanced techniques, you can take your Shopify analytics to the next level. Whether it's tracking Shopify client IDs, excluding irrelevant query parameters, or implementing custom dimensions, these tips ensure your Matomo setup delivers clean, actionable data.

If you're looking for more advanced use cases or a deep dive into specific configurations, stay tuned for our next guide!

Talk to us to find out more


Theo dõi

Theo dõi bản tin của chúng tôi và không bao giờ bỏ lỡ những tin tức mới nhất.