Disqus events when comment is entered?


I plan to use Disqus on my website. It has a “blog”-style layout. On the front page I want to display the comment-count for every blog-entry. I know I can connect to Disqus to get the counts but I would prefer to just save the comment – count into my database directly for the blog-entry when someone enters a comment.

So getting the count would not affect performance/load time of the main page. Is there any event that is fired if someone entered a comment on my page that I can listen to?

AngularJS would be a bonus but a simple javascript or jQuery solution would be helpful, too.


function disqus_config() {
    this.callbacks.onNewComment = this.callbacks.onNewComment || [];
    this.callbacks.onNewComment.push(function(comment) { 
      // Code to store the comment count here.

You can use this to add callbacks to certain events and hook into custom analytics systems. (The same would work for sending events to Google Analytics for instance. Here you’d just need to make an requests to your counter endpoint.

More info here: https://help.disqus.com/customer/portal/articles/466258-capturing-disqus-commenting-activity-via-callbacks

Answered By – Seer

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published