Multiple Stores on One Domain


#1

What would be the best way to track 3 different ecommerce stores on a single domain? They’re set up like this:


www.my-domain.com/store/1/cart.cgi
www.my-domain.com/store/2/cart.cgi
www.my-domain.com/store/3/cart.cgi

I want to track the overall traffic for the static pages on my-domain.com, plus the pages visited and orders placed in each store. Should each store get set up as a “website” or is there a better way to do this?

Thank you,
Frank


(Matthieu Aubry) #2

Setup each store as a website.

Then you can track also all stores in one fourth website: JavaScript Tracking Client: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3


#3

I read “Multiple Piwik Trackers” but I’m not quite clear on what to do. Using the example, I think I need to do the following:


<script type="text/javascript">

window.piwikAsyncInit = function () {
    try {
        var piwikTracker = Piwik.getTracker("www.my-domain.com/", 1);
        piwikTracker.trackPageView();
        var piwik2 = Piwik.getTracker("www.my-domain.com/store/1/cart.cgi", 2);
        piwik2.trackPageView();
        var piwik3 = Piwik.getTracker("www.my-domain.com/store/2/cart.cgi", 3);
        piwik3.trackPageView();
        var piwik4 = Piwik.getTracker("www.my-domain.com/store/3/cart.cgi", 4);
        piwik4.trackPageView();
    } catch( err ) {}
};

</script>

Is this correct? If so, then where does this get put? Inside the main Piwik Tracking code block or somewhere else?

If this is not correct, then where am I going wrong?

Thanks,
Frank


#4

Hi,

No you need to go to Settings-> Websites, and create separate Website for each of your stores, then embed tracking codes at those stores. visit Manage Websites - Analytics Platform - Matomo for more info.

Regards,
Michal