Google Analytics

AI-generated summary

The discussion revolves around connecting Google Analytics data with Discourse’s dashboard data. dfrick wants to build a custom dashboard including metrics like likes, comments, and topics, available via Discourse but not Google Analytics. Bas suggests using third-party tools like Community Analytics or DiscourseMetrics, but dfrick seeks direct data access for a holistic view across multiple channels.

Bas provides a solution involving JSON data retrieval from https://meta.discourse.org/about.json and a Google App Script example to feed the data into a Google sheet. The script uses the UrlFetchApp function to fetch the JSON data and parse it for use in the spreadsheet.

Hi - I’m wondering if there’s a way to connect to the reporting data inside Discourse’s dashboard? I’d like to build a dashboard that includes some of the metrics / data that isn’t available via Google Analytics, such as likes, comments, topics, posts, etc…

Specifically, is there a way to pull this data into a google sheet?

Alternatively, do you know if this data is accessible somehow via google analytics?

Hi David,

You could take a look at Community Analytics or DiscourseMetrics which do a lot of these things for you.

Happy to answer any questions about the former, since – disclaimer – I built that Community Analytics one with a friend of mine.

And I’m pretty sure @DiscourseMetrics.com is happy to answer any questions about … DiscourseMetrics :slight_smile:

Hey - thanks for the reply Bas. I’m aware of those but I’m just trying to get access to the data in order to create my own dashboards. My goal is to sync up a few data sources into one dashboard to look at data holistically across a few channels, domains, etc…

The easiest way to do this is to have the data feed into a google sheet. Do you know how I might do that?

Ah, that’ll require some json and Google app script trickery :slight_smile:

You can get the data in json from here: https://meta.discourse.org/about.json

Here’s an example: https://docs.google.com/spreadsheets/d/1eR6JX7r28nkoOTM-A0eLdFIDFwEn0vYpm9RJTtrO5cg/edit?usp=sharing

Use this (or prettier, this is just a quick fix) code in the google script:

function discourseStats(url) {
  var url = url||'https://meta.discourse.org';
  url = url + '/about.json';
  var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true});
  var data = JSON.parse(response);
  var stats = data.about.stats; 
  var array = []
  for (key in stats){
    array.push([key, stats[key]])
  } 
  return array;
}