0
votes

I need to track the most commented post on my site. My current approach is to load DISQUS comments dynamically on a click event. Whenever the user clicks a link, I reset DISQUS comments using

DISQUS.reset({
  reload: true,
  config: function () {
    this.page.identifier = disqus_identifier;
    this.page.url = disqus_url;
    this.page.title = disqus_title;
  }
});

My problem is I can't get the onNewComment event work using this setup, I've already tried everything on google but nothing fires the event.

Is there any easy way to get the the comment count using javascript. I dont want to use the api because it does have a rate limit on calls. All I want is just get DISQUS comment and then send it to the server so that I can track it.

I've already tried every method I found in google but nothing works for me.

1

1 Answers

0
votes

My problem is I can't get the onNewComment event work using this setup

=> as seen on Disqus help section : http://help.disqus.com/customer/portal/articles/466258-capturing-disqus-commenting-activity-via-callbacks

The following callback can be added to the disqus_config function before the main Disqus Javascript include

function disqus_config() {
    this.callbacks.onNewComment = [function() { trackComment(); }];
}

It works fine with me