Track Events in external PageID

Hi everyone,

i hope you can help me.

In Matomo i have one domain and one subdomain with unique IDs.

domain[dot]de (PageID 1)
subdomain[dot]domain[dot]de (PageID 2)

On both Pages there is a Section with current brochures which are the same content.

It is possible to track only the clicks from the section with pageID 2 and the rest by pageID 1 on domain[dot]de?

Thanks in advance

Hi @reke-buchenau
What do you mean with pageID… Is it page Name / Page URL or the pageViewId?

Hi Philippe,

thanks for your response. Sorry, i mean the idSite.

Yes it is possible to track on 2 different site IDs at the same time… How do you track? (MTM, javaScript API, another API…)

i track with Javascript.

On my first page i use this script:

var _paq = window._paq = window._paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.domain.de"]);
_paq.push(["setDomains", ["*.domain.de"]]);
_paq.push(['trackPageView']);
_paq.push(['enableHeartBeatTimer', 5]);
_paq.push(['enableLinkTracking']);
(function() {
var u = "https://analytics.domain.de/matomo/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '1']);
var d = document,
g = d.createElement('script'),
s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
})();

With this Snippet for example i track events:

<a href="brochureLink.domain.de" target="_blank" title="brochure" onclick="_paq.push(['trackEvent', 'Beilagen', 'Click', 'Sidebar brochure - brochure']);"><img src="brochureImage" alt="brochure"></a>

I want only this TrackEvent sent to SiteId 2