I would like to use Matomo in an app that different websites use. Lets call it MyApp.dom
Websites use it and may publish several of them so i need to know what i can do to:
track based on the website that is being tracked. Ie if a website calls myapp.com/app then Matomo is loaded and i need to track interactions based on the actual website not only as a myapp interaction
as there can be multiple apps not only point 1 info needs to be available but also i need to know how i can print and or send an extra piece of info as to what the id of the actual app instance is.
any chance i can query this info separately so i can then create separate dashboards for each website?
In iframes, JavaScript context is separated from the main document, then you won’t have any conflict between 2 apps in the same page, or event between your app and the main app…
With JavaScript rendering, I suggest you track with the low level HTTP API. Then you won’t have any conflict with other parts of the application.
In case of iframe, no problem, this will work well.
In case of injected DOM via JavaScript, if Matomo is also used in the app host, all events will be sent to all Matomo instances…
The I suggest the low-level calls: https://developer.matomo.org/api-reference/tracking-api
is there a way to customise what data is sent so that then i can use it for the splitting of the data? ie
I understand i can do _paq.push(['setSiteId', '{{ MATOMO_SITE_ID }}']);
however i need to pass more than one id. One is lets say the site ID and the app id.
These are dynamic, ie i dont set them up on Matomo first. They are set up in the application and used by the website to call the application. For instance
It looks like custom dimensions and events could be a bit redundant of each other. So going back to my questions what is the best way to report custom information on page load?