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

**URL:** <https://meta.discourse.org/t/how-to-use-api-to-pull-metrics-from-discourse-into-google-analytics/67406>\
**Category:** Development\
**Created:** [3 أغسطس 2017، 7:26م UTC](https://meta.discourse.org/t/how-to-use-api-to-pull-metrics-from-discourse-into-google-analytics/67406 "2017-08-03T19:26:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [11 أغسطس 2017، 5:23م UTC](https://meta.discourse.org/t/how-to-use-api-to-pull-metrics-from-discourse-into-google-analytics/67406/2 "2017-08-11T17:23:58Z")

</div>

You can pull topic listings off the API and you can even run custom reports if needed using [data explorer](https://meta.discourse.org/t/32566?silent=true).

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)

---

_[View the full topic](https://meta.discourse.org/t/how-to-use-api-to-pull-metrics-from-discourse-into-google-analytics/67406)._
