you are right, this will not fetch the most of the origin domain_uids.
If i understand correct the first argument of CLIENT_ID() is the scope or namespace on the amphtml side, and the 3rd argument is the fallback cookie name, if the 3rd isn't provided the first is used, described here:
I think it would be good to make the fallback cookie name configurable like:
<amp-analytics type="snowplow" id="snowplow">
but then the issue with the other metadata still exists.
For now we should be able to get the clientID of the amp-pages as duid. But there will be a lag between duid in amp pages and origin domain pages. For the configuration of the cookie name i can make a new PR, maybe someone creates an issue for that.
Would be also nice, if someone has some ideas how to proceed with the metadata issue.
Maybe projects with amphtml pages stores the domain_uid in an additional cookie without the other metadata.