I just might have a easy question but I am struggeling a little with it. If I host my matomo here https://mymatomo.com, all tracking requests go to this domain and some of those might be blocked due to apps and extensions.
Is it possible to create custom tracker domains, so my tracking is going to https://analytics.mywebsite.com and then forwards the calls & data to my Matomo instance? Can I achieve this with a CNAME or redirect, or am I missing something here?
But that will not resolve the problem with the blocking, because in the most cases the matomo.js (piwik.js) is blocked. You must also use symlinks for the matomo.js (piwik.js).
not quite sure if I understand this but I the other url for the “first party tracking” is the one of a customer so I would need make a entry in his DNS right? The change of the .js and php should be possible with the white label solution
A solution with CNAME sounds like easy, but is complicated about the SSL certs (both must have one own), and it upranks the website as “cloaking”.
The using of a subdomain is (literally) suboptimal. Few browser rank this as third party and there is no advantage. When you host the website and matomo on the same domain, it is better to use a own subdirectory (url and server). Than the DNS stay untouched. In your case this is irrelevant, but it is simpler with a subdirectory instead a subdomain.
As far as I know only the matomo.js / piwik.js is affected. Not the matomo.php / piwik.php.
Workflow:
example.com = your matomo installation.
Your domain setting in the webhost/server backend (example): example.com → (dir) /matomo/
Create a subdirectory: (dir) /matomo/whatever/
Create a symlink: (symlink) /matomo/whatever/whatever.js → /matomo/matomo.js
Use this URL path for the matomo JavaScript tracking code: example.com/whatever/whatever.js
This points to: /matomo/whatever/whatever.js → /matomo/matomo.js
So, the matomo.js is never visible in the URL path.
I think I understand it partially but what if I have a shopify store (client) and do matomo as agency setup for multiple clients (sorry if this is a stupid question). How could I make it happen, that all URLs for his website are on his domain https://clientsite.com and the tracking data ends up at https://matomositeurl.com I think this is kind of what the eTracker Blog article was about right?
I don’t understand your request. Matomo is only a tracking code that is implemented in website-pages. With this tracking code the matomo installation will be requested, respectively the code implement the matomo.js in each website-pages.
When you use symlinks for the matomo.js and the matomo.php you must modificate your tracking code on three points:
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//example.com/whatever/"; ←←← MODIFICATION HERE
_paq.push(['setTrackerUrl', u+'whatever.php']); ←←← MODIFICATION HERE
_paq.push(['setSiteId', 1]); ←←← THE TRACKING SIDE ID HERE
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript';
g.async=true;
g.src=u+'whatever.js'; ←←← MODIFICATION HERE
s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
The Urls of the website-pages stay untouched.
When you need to modificate the website-domain, use this:
Hi @melbao
I think what @Johannes_Boppre means is the case where there is an e-commerce and analytics are not operated by the same company (analytics are done by web agency).
@Johannes_Boppre, I think you can do either log analytics (just for page views) or develop tracking proxy (in the web site backside language) or “proxy” the web agency tracking assets (scripts + API) as @melbao suggested:
A tracking proxy sounds quite interesting, maybe that is something that could be exposed as API on the analytics backend in a subdirectory and then the domain can point to it.
It’s about third party cookies. That match only when you use tracking with cookies. It match also with subdomains, because few browser handle subdomains as third party.