Best practices for duplicating data to two different site id's

I have a client with huge number of websites to track.

I want to have single site data and global rollup (with custom dimensions). For this, I need to send data to two different site id’s.

  • local site id
  • global site id (“manual roll-up”, bc I need those custom dimensions)

So basically I want to do this - https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers - but with the Tag Manager.

Any best practices for this kind of scenario with the tag manager?