search iconsearch icon
Type something to search...

Basic tools for blogs

Table of Contents

Open Table of Contents

0. Why?

If you just created a blog you will probably want to have common and usefull features like:

  • Analytics
  • Mailing list
  • Comments section

It can seem like a difficult task but if you use modern (and free) tools is quite the opposite.

In this post I am going to explain how to use Google Analytics to track visits, Mailchimp as a mailing list and Disqus for the comments.

It won’t be a step by step guide, instead I will highlight the things I think are more relevant.

1. Google Analytics

You should first register your web page and then copy and paste at the scripts part of your base template the code they provide.

One thing I belive is really important is to filter out your own traffic to the webpage while you are developing or testing. In my case I did a filter to check if the host of the page is the bare domain of my page. This way I will efectively exclude visits from localhost or testing branches like

The complete code I am using is:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=""></script>

  /* Only track the page when it is in the main domain. No or localhost */
  if ("" ||"") {
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'YOUR_ID');

Remeber to replace YOUR_ID with the appropiate value. As a reference my id is UA-116253568-1 yours will probably have a similar format.

Other ways of filtering the traffic would be:

  • Domain LogoUsing IP filters. You will need a static IP for every computer you use to develop.
  • Using cookies.

2. Mailchimp

This service is the one that involves less code. Setting it up can be done through their webpage after singing up. I recommend that you customize some things:

  • Sing up form. There you will also get the URL that you will use in you site.
  • Set up reCAPTCHA to avoid robot related problems.

When you have finish that you can put a button in your page so that people can suscribe.

<a href="http://URL_LINK"> <!-- Use your own URL -->
  Subscribe to the mailing list

3. Disqus

Setting up Disqus is really easy. You only need to register and then copy and paste two code parts. The first one will be the div with the comments:

<div id="disqus_thread"></div>

And then the javascript part:

  var disqus_config = function () {
    // Replace PAGE_URL with your page's canonical URL variable = '{{ code }}';

    // Replace PAGE_IDENTIFIER with your page's unique identifier variable = '{{ code }}';
  (function() { // DON'T EDIT BELOW THIS LINE
    var d = document, s = d.createElement('script');

    // Replace this with your disqus page url
    s.src = '';

    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
  Please enable JavaScript to view the <a href="">comments powered by Disqus.</a>

Remeber to change with the full url to the current post and with a unique id for everypost. Be sure that they are different in each post. And also change s.src with the url you just registered in disqus.

As you can see it is not that hard to use those tools from raw html. If you cannot access your blog source code there also integrations for most common technologies to use the same tools. For example to set up Google Analytics you will only need to write your site ID.