You can do standard JS but it runs inside an iframe, so your JS won’t have access to most of the page variables if you’re relying on that. So things like dataLayer won’t be there. They do expose a “defined set of Instant Article data” (though they don’t define it, of course).
https://developers.facebook.com/docs/instant-articles/analytics
Here’s how Adobe suggests you do it, for comparison:
https://marketing.adobe.com/resources/help/en_US/sc/implement/analytics-facebook-instant-articles.html