« »
Jun 10
2010

Recently Avinash Kaushik shared with his Facebook friends that his blog reached the following millstone: “# of comments on my blog = 8,000 today! Context: 221 posts. 471k words in posts. 742k words in comments.”

That is an average of 36 comments per post and 92 words per comment. Congratulations Avinash!

For Analytics oriented bloggers such as Avinash, I am sure as much as they love and appreciate all their blog readers they will always value the engaged readers who make the effort to drop a line or two seeking clarification, encouraging them to write more or giving them feedback.

This segment of blog readers is by all means the fuel that keeps bloggers alive and encourages them to continue to write and share what they have in mind. Therefore, studying and analyzing the behavior and the user experience of this segment is very important for optimizing the blog to achieve your blog objectives.

In this post I will walk you through few basic steps that will help make this segment of engaged readers available in your Google Analytics report.

Assumptions:

  • You have Google Analytics installed in your blog
  • You are using WordPress as a platform for your blog (of course you can apply the same method to other blogging platforms)

The How:

Our approach is a three-step process:  add custom code, create a Goal in Google Analytics which tracks the number of comment submissions and then create an advanced segment for those who converted.

Step 1) Add custom code to the comments’ form code:

Since in WordPress there is no unique confirmation page – thank you page – that visitors see once they have submitted their comment, we will need to fire a virtual page every time the “Submit” button is clicked.

We will need to modify the comments form’s code and add some JavaScript code to it. The code will fire a virtual page every time the “submit comment” button is clicked. The code for the comments form is found within the comments.php file, which can be found under your WordPress theme folder [../wp-content/themes/default/comments.php]

  • Add the following code to the onclick event of the “submit comment” button:

onClick=”javascript: _gaq.push(['_trackPageview', '/comment-submission.php']);”

Below you will see how the code will look after the JavaScrip insertion, this depends on the version of the Google Analytics tracking code you are using:

Asynchronous snippet

<p><input onClick=”javascript: _gaq.push(['_trackPageview', '/comment-submission.php']);” name=”submit” type=”submit” id=”submit” tabindex=”5″ value=”Submit Comment” />
<?php comment_id_fields(); ?>
</p>

Traditional snippet

<p><input onClick=”javascript: pageTracker._trackPageview(‘/comment-submission.php’);” name=”submit” type=”submit” id=”submit” tabindex=”5″ value=”Submit Comment” />
<?php comment_id_fields(); ?>
</p>

Step 2) Create a Goal:

Every time the virtual page that we created in step 1 is fired, it will trigger a conversion and the hit will be available in the Goals report.

  1. Log in to your Google Analytics account and then click “Edit” beside your profile. You will need to configure goals for each profile you want the Goal to show up in.
  2. Click on: +Add Goal
  3. Enter the following Goal Information:
  • Goal Name: Blog Comment Submission
  • Active Goal: On
  • Goal Type: URL Destination
  • Match Type: Head Match or Exact Match (in this case both will work)
  • Goal URL: /comment-submission.php

Step 3) Wait a Few Days and Analyze your Goal Performance

Your Goals will not work backwards, so you will need to wait for Goal data to appear in your reports. Now you have the number of comment submissions.

Is creating a goal is enough for our deep analysis? Not really! It will be nice if we can analyze traffic only from this specific segment of our blog visitors. Advanced Segments is the answer!

Step 4) Create an advanced segment

Now let us create an advanced segment that only shows the visits of those who submitted comments.

  1. Sign in to your Google Analytics account
  2. Advanced Segments > Create a new advanced segment
  3. Select the “Goal Completion” Metric for the Goal that you created in step 2

By applying this segment, now you will have more insight about the  blog commenter’s user experience, their traffic sources, geographical locations, time on site, browsers, screen resolutions, etc.

Apply the same concept to your email subscribers, contact-us requests, social media followers or any other segment of your blog readers you are interested in learning more about.

Happy Analyzing :)

Related Posts

Tags: , , , ,

16 Responses to “Segment Blog Commenters in Google Analytics”

  1. Thomas Petty says:

    Thanks you guys. This is awesome, already have a client that I’m thinking of implementing this on (in addition to my own blog).

    Ooops, I just tripped your virtual page. :)

    Tom

  2. Omar says:

    Simply awesome guys! This is a great way of breaking down engagement! I am going to try it!

    @omarjead

  3. Thanks Thomas and Omar for reading! Share with us your cool findings about this amazing segment of your blog readers :)

  4. Thanks, this is a great trick.

    The only problem I see here is if you use third party comment systems such as disqus, very spread nowadays.

  5. Edgar,

    Unfortunately, many of these 3rd party modules are locked and hence limit our ability to track certain events in our sites.

    I don’t know about Disque, but in general you have two options:
    1) If the module allow for external “conformation page”, then set the module to that and use “confirmation page” URL for your Goal settings.
    2) If the external conformation page is not an option and you have access to the source code of the module, then you can implement the same method we used for the WordPress comments form.

  6. Thanks for the great tip. Just added it to my blog, I´ll let you know how it goes.

    By the way you mentioned “Apply the same concept to your email subscribers, contact-us requests, social media followers or any other segment of your blog readers you are interested in learning more about.”

    How do we go about it?

  7. Best SEO Practices,

    Basically create a GA Goal and then create an advanced segment for it. If you have a unique “thank you page” for the event you want to track then that will be your Goal URL, if the confirmation/thank you message appears in the same page then you have to add JS code (step 1 in the post) to fire a virtual page and use the virtual page as your Goal URL.

  8. Thanks for sharing, will use in my and my clients blogs.

  9. Hello Allaedin,

    Thanks for the insight. I will use this.

    I can probably have a conversion funnel with the step of someone reading the blog. And so, I can track how many submit (or don’t) comments after reading my post.

    Do you know of an event when someone reads a post? I was thinking of using URL of the blog post as the goal step, but thought of asking in case if there is a better way to track that.

    -Deven

  10. Superb post, I finally fixed my Commentors issue at my blog. Thanks for explaining

  11. Thanks for the post – I had no idea analytics could track blog comments so well. I’ll have to try this on my sites.

  12. Thanks for shared useful information, good trick.i have added it to my blog, I´ll let you know how it goes.

  13. Dzianis says:

    Thanks for the tip Allaedin, will try it on my blog )

  14. Bennie says:

    Apply the same concept to your email subscribers, contact-us requests, social media followers or any other segment of your blog readers you are interested in learning more about.

  15. Dubai Web Design says:

    This is something new at least to me that I can offer to my client as well as to my blog.

    I’ll start segmenting my readers from today.

  16. neti pot says:

    I stopped using Google Anayltics and moved to piwik so my data was not shared with Google. However I really miss the goals aspect of GA.

    I may well go back to GA for some of my blogs and give your comment code a try

Leave a Reply