If you don't care about returning users, here's GA pageview tracking in a tweet:
fetch('
google-analytics.com/collect?' + new URLSearchParams([
['v', '1'],
['t', 'pageview'],
['tid', 'UA-XXXX-Y'],
['cid', Math.random()],
['dl', location]
]))
(replace UA-XXXX-Y with your ID)