Hi Bryan,
Time passes at a different speed lately, sorry for the late reply.
Yes, we have plans on adding more custom stuff regarding exposing data to modules like Matomo. But the changes needed to do what i read you need (and i could be misunderstanding, you probably have other needs) are not really big (good news) so the code will also not too much on our side.
That is the core JS and its super slim. So what i pretend is to do something similar. simply attach on every Digital Object page an extra Javascript settings/custom tiny JS with the things i want to track, including Dimensions but also some custom Variables given the weird fact that dimensions can not be multivalued and will never be, see:
basically we will have a hard dependency on the matomo module, inject our own JS and out settings to attach some extra values. Then alter the Matomo provided admin form to allow some extra UI facing settings from our side, specific to Archipelago Digital Objects (fancy name for Any Node bearing a Strawberry field, easy to relate identity concept). Still Its a hard choice (v/s coding the whole thing again because, well, the module itself is not written fast enough for my own standards and adds some overhead)
The catch (or a few catch-es). I'm not sure i want to have too many modules in Archipelago as a statement of sustainability and role separation (we already have 3, pesistance/datatyping, output, input) but also how hard it is to keep anything backwards and forward not-deprecating in the Drupal world. I spend more time making sure all still works on every update of Drupal than coding new things.
Still, all this could eventually go into an Archipelago SEO module, where i would want to expose also the JSON-LD/Structured metadata we generate on the fly via the twig template/format_strawberryfield module (quite different to the schema module everyone uses that depends fields and tokens), but if so it will make the later a dependency and i believe you folks could see that as a problem. basically i'm mostly sure our solution even when Drupal 9 aware and totally compatible, will be quite specific to Archipelago Digital objects and metadata needs. For D8/D9 normal content types and everyday fields we feel there is enough in the market and would make supporting that code for us quite complex (unless we get contributors/and maintainers!).
Second catch . There is another issue with Matomo. It requires Matomo Server side/deploymennt configuring and some of those configurations are very complex to deliver in an automated way. Means you have to go step by step and deploy the server and enabled plugins via the symfony console. I had to do some circus magic and double-mortal-flips without a safety net on the LASIR/Islandora 7 project to reach an in-between state, but it also makes me feel that if i can not automate the deployment, then i need to write very good documentation and make the Drupal side of things quite aware that the other side could be not well deployed. Extra logic and extra failure points.
As you see i have been thinking a lot about this and will for sure provide code and solutions. But all of them will, in some way or other, serve the Archipelago needs and because of that to some extend less the generic Drupal/ Islandora 8 / content types with many fields/ use case.
Take care and please let us know if this answers some of your questions ideas, and if you have further thoughts, comments or suggestions. Also thanks for bringing this up
Cheers
Diego