We know that many publishers use Google Analytics to understand their site's traffic. Perhaps that also includes Disqus Analytics for insights about your readers' engagement. Wouldn't it be convenient if you could capture Disqus commenting activity within Google Analytics?

In this tutorial, we’ll show you how to start tracking total new Disqus comments in Google Analytics. Once configured, you’ll be able to measure the number of comments your readers are posting alongside the metrics you already track with Google Analytics such as page views and time on site.

Tracking new Disqus comments in Google Analytics

This tutorial requires some familiarity with JavaScript. Otherwise, we recommend consulting a developer on your team to assist you. In addition, make sure you meet the following requirements before proceeding:

To track new comments posted on your site, we’re going to be using a callback function within your Disqus embed code. Specifically, we’ll be adding the onNewComment callback to the existing disqus_config function:

When a new comment is posted on your site, this triggers the onNewComment callback to fire a “New Comment” event that is sent to Google Analytics. Note that this only works for new comment activity and cannot be applied retroactively.

If you're using the Disqus WordPress plugin, the disqus_config variable can be added anywhere on the page's code where Disqus is installed. This could be added wherever you normally insert JavaScript via your WordPress settings (i.e. the Text widget).

How to track total comment reads

If you’d like to track how many times someone reads the comments on your site, you can configure a “read” event to be sent to GA whenever the Disqus iframe comes into view on a page. To find more information on event tracking in Google Analytics, check out their documentation.

Viewing Disqus activity in Google Analytics

ga-dashboard-widget-config

In Google Analytics, head to Reports > Behavior > Events. From there, create a new widget in your dashboard that tracks total new comments posted over time. Use either a Metric or Timeline-based widget for tracking cumulative total comments or daily trends, respectively.

ga-disqus-activity

Allow Disqus activity to populate in Google Analytics for a few days. Once you do, you can leverage Google Analytics’ various tools to understand how your audience engagement impacts the other metrics on your site and develop strategies towards increasing engagement.

Not using Google Analytics?

If you don’t use Google Analytics, you can still track total new comments in other analytics services including Chartbeat and Parse.ly using the same method as described above. You will need to replace the Google Analytics script though with your own script for sending events to your analytics service.

💬 Discuss: Which metrics do you currently track?

Join us in the discussion below and share the metrics that are vital to your success. We’d love to hear from you so share any questions and feedback you might have. We hope you found this guide useful.