Categories: Web Analytics

Segment Blog Commenters in Google Analytics

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

Allaedin Ezzedin

VP Analytics Engineering Allaedin wisely guides friends, family and colleagues with honesty and care. He is a long time digital analytics industry veteran leading Cardinal Path’s analytics team with over a decade of experience as a digital marketing and senior analytics consultant.

Share
Published by
Allaedin Ezzedin

Recent Posts

Google Delays Third-Party Cookie Deprecation to 2025

Google announced on April 23 that it will again delay third-party cookie deprecation (3PCD) in…

6 days ago

Understanding Funnel Reports in GA4

Funnel reports have long been one of the most actionable reports in a marketing analyst’s…

1 week ago

GA4 Monetization Reports: An Overview

GA4’s Monetization reports provide organizations with simple but actionable views into the revenue-generating aspects of…

2 weeks ago

This website uses cookies.