How to use API to pull metrics from Discourse into Google Analytics?

You can pull topic listings off the API and you can even run custom reports if needed using data explorer.

A great place to start would be to create an admin api key and then, for example, look at /admin/reports/topics when clicking refresh in chrome dev tools you will see it hits:

/admin/reports/topics.json?start_date=2017-07-11&end_date=2017-08-10&category_id=all&group_id=&_=1502472121727

So you can use that particular endpoint to get topic stats (you can similarly get user stats and so on)