[Deutsche Version]

Outdated: Due to the Changes in EU privacy laws (GDPR), I deciced to shut down comments at this blog. Nobody wrote comments anyway.

If you want to comment on my or at foonathan’s blog, you will have seen that you need to tab a button to load the comments form. I want to share with you, why. While Jonathan’s blog is primarily in English, my mostly German readers can switch to the German version of the text.

Example: The comment section needs to be activated, Screenshot: foonathan.net

What is that all about? Disqus as a audience engagement system

I use Disqus because it gives me an audience engagement system and yet simplifies my hosting effort immensely. My old WordPress blog had a commenting system included, but required a MySQL database and active PHP. This is muuuch slower, and also a big security concern if you don’t protect your site in a reasonable manner1.

Since the moving to jekyll, my server only hosts “dead” HTML pages which have been generated once and don’t perform server action every time somebody tries to read my blog. Jonathan also uses jekyll, since he is hosting on GitHub Pages.

However, our readers cannot write comments on our jekyll posts! And that’s where Disqus comes into play:

Screenshot von disqus.com

Disqus can be embedded into static HTML pages (like this blog) and works as a commenting system for me. For my needs, the free version is enough: It protects me against Nigerian princes2 and discussion-heavy posts are featured underneath the comment section.

Why do you use this two-tap solution?

Disqus is super, but there are two major points that speak against this system:

  1. Pages that embed Disqus need much longer to load since the client-side Javascript manipulates the DOM tree forever! In some browsers, the page is “white” until everything is set up - especially painful when you optimize for Google PageSpeed Insights.
  2. You should decide on your own, if you want Disqus to know that you’re reading this text. I am the two-faced Privacy-Janus3 and I don’t want Disqus to load by itself.

For similar reasons, Heise Publishing published the Shariff library for sharing buttons in 2014 - right around the time when I designed my and Jonathan’s blog. It works quite similar to my button: The external service is only called, if you click the button!

The code in my website is pretty straight forward:

HTML:

<h2>Comments</h2>
<div id="disqusActivate">
  [...]
  <button id="disqusActivateButton">Load Disqus</button>
  [...]
</div>
<div id="disqus_thread"></div>

JavaScript:

// EventListener for the button
document.getElementById("disqusActivateButton").addEventListener("click", function() {

  // Send an event to my PIWIK instance
  _paq.push(['trackEvent', 'Blog', 'DisqusHit', window.location.pathname]);

  // Do Disqus Stuff (this is pretty much the example code)
  // The thread will be inserted inside div#disqus_thread
  var disqus_shortname = 'jannikblog';
  (function() {
    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();

  // Delete the description
  var e = document.getElementById("disqusActivate");
  e.outerHTML = "";
  delete e;

});

Downsides

Without doubt, this system has it’s downsides.

First and foremost: The reading/commenting ratio is much lower than it would normally be, and no conversation can evolve when the button blocks readers from reading what somebody commented..

Also, it is difficult to outsource your work: While researching for this article, I learned that Disqus has a new investor/owner and maybe, they’ll close the free tier next month and all comments on my site are flushed4.

Conclusion

This existing system did not get me into a lot of trouble, but how are you doing comments on your blog? Mail me … in the comments! (just hit the button that says something with disqus, I’m too lazy to update my whole layout for this English post)

  1. I was 14 or 15 at this time and it was more by luck than judgment that my site was not hacked. 

  2. Many Nigerian princes that offer me money in emails are very handsome! But some are …ehh… not. 

  3. You’re loading pretty font for that page! *stands ashamed in the corner* 

  4. I’ve read the part of the post which says that everything will stay like it is. But you never know. 

Avatar

Veröffentlicht am von Jannik

Technik IT-Sec english

19 | der blasse, dünne Junge aus der Nachbarschaft | Macht Web Design, Theatertechnik und Pfadfinder | Ist #Wö‑Leiter | Studiert was mit Medien