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?
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?
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;
}