As many of you know, I love writing about Google Analytics. I’m a data junkie, and there’s nothing I enjoy more than learning more about the visitors coming to my blog. One of the best ways to get actionable data out of your Google Analytics is to set up goals.
Setting up a goal in Google Analytics tells it that someone has completed something important on your website, such as buying product, signing up to your email list, or similar. For those who aren’t interested in selling products or capturing mailing list subscribers, is there anything else you can count as a goal on your blog? Absolutely – you can start with your comments!
What You Can Learn from Setting Up Blog Comments as Goals
Here are a few things you can learn from setting up comment form submissions as goals in Google Analytics.
- Discover what referral sites are sending the most commenters. This will let you know what social media sites, guest blog posts, or other referrers are sending traffic that not only reads your posts, but also gets engaged. On the flip side, if you are getting a lot of spam, you might discover the sites sending spam traffic to your blog. This could lead you to finding lists that are sending you nothing but spam and, if that is the case, you can ask them to remove your blog from their list.
- Learn the difference between commenters and regular traffic. On my blog, one interesting tidbit is the average time on site for regular visitors is 1:23 vs the average time on site for commenters is 10:31! A good reason to encourage comments!
- Find out what content on your blog your most engaged audience enjoys so you can produce more of it.
- See what part of the world your commenters are coming from. If you are targeting a specific region, but your commenters are coming from somewhere else, you might want to look into the reasons why.
So now that you know just a few reasons to set up comments as goals, let’s look at the ways you can set up your WordPress and Google Analytics to track your blog comments as goals.
Method 1: Tracking First Time Commenters Using Thank You Page & URL Destination Goal Type
For those who don’t want to get into hacking code and modifying templates, this is the easiest way to go. The only downside to this method is that it will only track the first time commenters to your blog. Also note that it will track every first time visitor that submits a comment, regardless of whether you go on to approve the comment.
The Basics of How it Works
Using a plugin, you will redirect first time commenters to a custom thank you page on your blog. In Google Analytics, you will set up that thank you page as a URL Destination goal type which tells Google Analytics that anyone who reaches the thank you page has completed an important goal.
Step 1: How to Set Up the Thank You Page in WordPress
Setting up the thank you page for your first time commenters is easy. Just create a new page on your blog, name it something like Thank You for Your Comment, and add some good content. This page can be as simple or complex as you choose to make it.

The goal is to think about what you would want your first time commenters to do next on your site, such as check out the main categories on your blog, sign up for your mailing list, or check out your latest product. You could also suggest that they connect with you on Twitter, Facebook, or Google+.
Step 2: How to Set Up the Redirect to the Thank You Page
Next, you will want to set up the redirect using the Comment Redirect plugin by Yoast. Add this by going to your WordPress Dashboard > Plugins > Add New and searching for comment redirect yoast. Once activated, you will find the settings for the plugin under the Plugins menu.

Here, all you have to do is select your thank you for commenting page from the dropdown and save settings.

That’s all it takes! All of your first time commenters will be directed to your thank you page.
Step 3: How to Set Up the URL Destination Goal in Google Analytics
The following directions are for Google Analytics 5, currently in beta. To use this version, click on the link at the top of your Google Analytics dashboard for New Version.
Last, but not least, you will need to set up the URL Destination goal in Google Analytics. Simply go to your blog’s profile in Google Analytics and click on the Settings wheel. Then click on the Goals tab.

To add a new Goal, click on the + Goal link.
If you have multiple websites / blogs, and want to view blog comment data across all of them as an Advanced Segment, be sure to use the same name, Goal set and position for each site’s blog comment goals. For example, on my main site, I set up Blog Comments set up as a goal in the second position of Goal set 2.
On my next website, I did the same, even though I haven’t utilized all of the goals in Goal set 1.
You will see why this is valuable later in the section on viewing your data in Google Analytics. Goals cannot be deleted and moved around later, so if you think you have more important goals to set up on your blog (like product sales, mailing list signups, etc.), save Goal set 1 for those and use Goal set 2, 3, or 4 for your comments.
Name your goal Blog Comments or similar. Then select the Goal Type of URL Destination. Enter the URL for the “Thank You for Commenting” page you created earlier into the Goal URL field. If the full URL for your page is http://domain.com/thank-you-for-commenting/, then enter /thank-you-for-commenting/ as the Goal URL. Your goal should look like this.

Click on the Save button to finish. Now your goal is ready to go. Be sure to wait at least 24 hours (and for a few comments) to collect some data before beginning your analysis.
Method 2: Using the Comment Form Submit Button & Event Goal Type
For those who don’t mind getting into the code and modifying template files, this is the alternative. Once set up, this method will track any comments submitted on your blog, by both first time and repeat commenters. Also note that it will track every visitor that submits a comment, regardless of whether you go on to approve the comment.
Disclaimer
Some of the following directions include modifying templates that generally should not be modified. Some things to keep in mind regarding this…
- Whenever you are modifying a template, be sure that you have a clean back up of it that you can upload immediately via FTP to your server in case your modifications make your website crash. Uploading an original file should set things straight. I use FileZilla, a free FTP solution or you can use the FTP client provided by your hosting company.
- Some theme providers will void their support if you modify their templates. Keep this in mind if you are used to getting support and will continue to need it. Or, if your site needs suport later down the road, upload an original template file in place of the one you modified.
- Be sure to note any template files you have changed and record the exact coding changes you have made. Whenever you upgrade the core WordPress platform, themes, or plugins, the upgrade might overwrite your changes. You will need to check after doing any upgrades that your code is still intact and possibly need to modify it again.
- While these modifications worked on my websites, they may not necessarily work on yours due to conflicting WordPress versions, themes, and plugins. While I would love to help you if you get stuck, please note that I am not responsible for anything that happens to your website.
For all of the following directions, I have been using WordPress version 3.3.1 and specific theme versions as noted.
The Basics of How it Works
Whenever someone submits a comment on your blog, they have to click the Submit button. You will add some additional code on the Submit button for your contact form. In Google Analytics, you will set up a Event goal type which tells Google Analytics that anyone who reaches the thank you page has completed an important goal.
Step 1: How to Add Additional Code to the Submit Button
The code you will need to add to your blog’s comment form submit button is as follows.
onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);"
The words Forms, Submit, and BlogComments sycn with the Google Analytics Event Goal Type settings for Category, Action, and Label. You can use different wording as you desire. You will add it to the Submit button for your comment form like this.
<input name="submit" type="submit" id="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" tabindex="5" value="<?php _e('Submit Comment', 'kubrick'); ?>" />
The only challenge is finding the comment form submit button on your theme. The following are locations and code examples for particular themes.
Standard WordPress Themes – Modifying the Comments Template File
If you’re not using Thesis or Genesis, you will want to start your search for your comment form’s submit button code in the comment template file for your theme. To view it, go to your WordPress dashboard > Appearance > Editor, and select the comments.php file from the right side. Then scroll through until you find the following highlighted code (or similar) for the comment form’s submit button.

You will want to add the Google Analytics event tracking code as follows, then click the Update File button to save your changes.
<input name="submit" type="submit" id="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" tabindex="5" value="<?php _e('Submit Comment', 'kubrick'); ?>" />
After you save the modified file, you can check your code by going to a blog post on your site, viewing the source code, and ensuring that the Submit button code looks like this.
<input name="submit" type="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" id="" value="Submit Comment" />
Be sure to test your comment form to ensure it is working properly by submitting a comment while logged out of your account. If the comment submits and posts properly, you can move on to the next section on setting up the Event Goal in Google Analytics.
Other WordPress Themes – Modifying the WordPress Core Comments Template File
If your theme has a comments.php file, but you can’t find the code for the submit button, you might instead find a call to the following function.

In this case, your theme is using the the comment form from the comment_template.php file within the core files located in /wp-includes/ folder. Most of Elegant Themes‘ templates, for example, do this. I use Notepad++ to edit files, but you can use your preferred source code editor. The line of code you are looking for should be at 1578 and looks like this.
<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
You will want to add the Google Analytics event tracking code as follows.
<input name="submit" type="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
After you upload the modified file, you can check your code by going to a blog post on your site, viewing the source code, and ensuring that the Submit button code looks like this.
<input name="submit" type="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" id="" value="Post Comment" />
Be sure to test your comment form to ensure it is working properly by submitting a comment while logged out of your account. If the comment submits and posts properly, you can move on to the next section on setting up the Event Goal in Google Analytics.
Thesis 1.8.2
If you are using the Thesis Theme (like I am on Kikolani), version 1.8.2, then your comment form’s submit button code is in the comments.php file within /wp-content/thesis_182/lib/classes/ folder. I use Notepad++ to edit files, but you can use your preferred source code editor. The line of code you are looking for should be at 96 and looks like this.
echo "$tab\t\t\t<input name=\"submit\" class=\"form_submit\" type=\"submit\" id=\"submit\" tabindex=\"5\" value=\"" . __('Submit', 'thesis') . "\" />
";
You will want to add the Google Analytics event tracking code as follows.
echo "$tab\t\t\t<input name=\"submit\" onClick=\"_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);\" class=\"form_submit\" type=\"submit\" id=\"submit\" tabindex=\"5\" value=\"" . __('Submit', 'thesis') . "\" />
";
After you upload the modified file, you can check your code by going to a blog post on your site, viewing the source code, and ensuring that the Submit button code looks like this.
<input name="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" class="form_submit" type="submit" id="submit" tabindex="5" value="Submit" />
Be sure to test your comment form to ensure it is working properly by submitting a comment while logged out of your account. If the comment submits and posts properly, you can move on to the next section on setting up the Event Goal in Google Analytics.
Genesis 1.8
StudioPress just released Genesis 1.8 Framework on Friday. I made the following changes to my blog before making the Genesis framework update, and everything was still working after the automatic upgrade to 1.8.
The Genesis Framework pulls the comment form’s submit button from the comment_template.php file within the core files located in /wp-includes/ folder. I use Notepad++ to edit files, but you can use your preferred source code editor. The line of code you are looking for should be at 1578 and looks like this.
<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
You will want to add the Google Analytics event tracking code as follows.
<input name="submit" type="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
After you upload the modified file, you can check your code by going to a blog post on your site, viewing the source code, and ensuring that the Submit button code looks like this.
<input name="submit" type="submit" onClick="_gaq.push(['_trackEvent', 'Forms', 'Submit', 'BlogComments']);" id="" value="Post Comment" />
Be sure to test your comment form to ensure it is working properly by submitting a comment while logged out of your account. If the comment submits and posts properly, you can move on to the next section on setting up the Event Goal in Google Analytics.
Step 2: How to Set Up the Event Goal in Google Analytics
The following directions are for Google Analytics 5, currently in beta. To use this version, click on the link at the top of your Google Analytics dashboard for New Version.
Last, but not least, you will need to set up the Event Type goal in Google Analytics. Simply go to your blog’s profile in Google Analytics and click on the Settings wheel. Then click on the Goals tab.

To add a new Goal, click on the + Goal link.
If you have multiple websites / blogs, and want to view blog comment data across all of them as an Advanced Segment, be sure to use the same name, Goal set and position for each site’s blog comment goals. For example, on my main site, I set up Blog Comments set up as a goal in the second position of Goal set 2.
On my next website, I did the same, even though I haven’t utilized all of the goals in Goal set 1.
You will see why this is valuable later in the section on viewing your data in Google Analytics. Goals cannot be deleted and moved around later, so if you think you have more important goals to set up on your blog (like product sales, mailing list signups, etc.), save Goal set 1 for those and use Goal set 2, 3, or 4 for your comments.
Name your goal Blog Comments or similar. Then select the Goal Type of Event Type. Under Goal Details, configure the Category, Action, and Label that is equal to Forms, Submit, and BlogComments. Your completed goal should look like this.

Click on the Save button to finish. Now your goal is ready to go. Be sure to wait at least 24 hours (and for a few comments) to collect some data before beginning your analysis.
Viewing Your Data in Google Analytics
Now we are on to the fun part – analyzing the data! There are a few ways you can view your Blog Comments Goal data in Google Analytics.
Explorer View
In any section where you have the Explorer, you can click on the Goal Set corresponding to where you placed your Blog Comments goal. Since mine is in Goal Set 2, I would click on that in the Explorer.

You can then see the percentage of goal completions for the specific data you are viewing.

Click on the column for your Blog Comments goal to see data related to the highest goal completion rate. Specific types of data you can see in relation to your blog comment goal completions include the following.
- Audience > Demographics > Location – View the top countries in which visitors are located and see the percentage of blog comments completed by these visitors.
- Traffic Sources > Sources > All Traffic – View the top traffic referral sources and see the percentage of blog comments completed by these visitors.
- Traffic Sources > Sources > Search > Organic – View the top keywords from search and see the percentage of blog comments completed by these visitors.
- Content > Site Content > Landing Pages – View the top landing pages that visitors enter upon and see the percentage of blog comments by these visitors.
Conversions & Goals Overview
Next, you can visit the Conversions > Goals > Overview section of your data, then select your Blog Comments goal from the Goal Option dropdown.

Here, you can see a graph of the number of blog comment completions in the date range specified.

Below, you can see Goal Completion URLs which will generally correspond to the posts that have received the most comments.

You can also click on the Source / Medium link to see the top traffic sources that lead to blog comments.

Advanced Segments
This one is my favorite. By creating an Advanced Segment based on your Blog Comments goal completions, you can see all of your data within Google Analytics based on just those visitors who submitted a comment. To do this, click on the Advanced Segments tab, and then the + New Custom Segment to create a new segement.

Name your segment Blog Comments Goal or similar. Click on the green dropdown that starts with Ad Content, and start typing in the name you gave your Blog Comments goal. Select the one that includes Completions.

In the next dropdown, select Great than, and then enter 0 as the value. Your completed segment should look similar to this.

Click on the Test Segment to see data from this segment, or click Save Segment to finish. Now you should see your Blog Comments goal like this.

To compare the data for visitors who comment vs. those who do not, click on the Advanced Segment area again and make sure the boxes for All Visits (under Default Segments) and your Blog Comments goal (under Custom Segments) are checked. Then click Apply.

Now you are ready to learn even more about your visitors and the differences between those that comment and those that don’t. I find that pages per visit and average time on site are much better for commenters compared to other visitors – a good reason to encourage comments!
Speaking of comments, if you have applied something similar to your blog or apply this, let me know how it goes!




Kikolani covers blog marketing and blogging tips for personal, professional, and business bloggers to succeed in search and social media marketing. Kristi Hines is a





Bookmarked! This isn’t a blog post, it’s a manual – and now that I’m beginning to use and understand Google Analytics a bit better, I’m eager to try some of the powerful features it offers, but until now honestly didn’t understand how to set these goals up. So thank you for this! (How Larry ever could’ve mistaken you for a Pretender, I just don’t know…
Note: I’m linking to a friend’s blog post, here in the CL link, Kristi – I’ll bet Abhi would be thrilled if you’d drop by and leave a comment to let him know what you think of his post, maybe add a pointer or two.

Holly Jahangiri recently posted Good Blogger And A Good Blog: What Are The Signs?
Thanks Holly! The official documentation on GA’s support site is sometimes hard to follow – glad this helped you set up some goals!
Superb stuff. This is one to bookmark and attack when I have some time over the weekend.
Adi Gaskell recently posted Do office hours apply to social media professionals?
Thanks Adi!
This is far too geeky to read. I see why your average commentator is here for 1 tenth of an hour! I never experimented with GA Goals before; never knew they were there, but just set one up — as I also use the Comment Redirect plugin. Thanks Kristi.
Ari Herzog @ New Media Explorer recently posted How Commentluv Premium Promotes Your Blog
Thanks for confirming what I was thinking last night before I scheduled this – definitely a super geeky post! Hope you get some interesting info from your new goal.
Awesome stuff!
I have just applied this to my Google analytics account. Thanks Kristi! And also thanks for mentioning the comment redirect plugin (I was looking for one – because the plugin I had used earlier redirected all of my commentators – whether they are commenting for the first time or not – to the thank you page.
Jeevanjacobjohn@Blognetworking recently posted Oh, No! Are you going to write on the same topic?
Thanks Jeevan! Glad that was the plugin you were looking for!
Thank you for the excellent write-up Kristi! I love your tips and tutorials because you always make them so detail oriented and easy to understand.
So far on my blog I am tracking Time on Site/Pages per Visit as goals, but I will definitely be adding blog comments as a goal going forward.
Chris @ Real Estate Blog recently posted VA or Conventional: What’s the Better Choice for a Veteran?
Thanks Chris! I like to write everything while going through the process myself so the steps can be followed in the right order.
Wow there is a ton of great information here. Got through the “Thank You For Your Comment” section and I will definitely be back at lunch to take a closer look at the rest! I am going to set up a Thank You page today.
Christelle Hobby recently posted SOPA Is Dead, But The Issue Isn’t
This is a great tutorial! I have been looking for how to do this for a long time. I knew it was possible, but was not sure how to set it up.
Susan Silver recently posted Improve Your Typography with Simple CSS
I set up some goals based on your previous post on KISSmetrics and love the data. And I dig the idea provided here… My only problem is I’m currently using Disqus comments and so the “Comment Redirect” plugin won’t work with it. If I de-activate an go to native WordPress comments, threading isn’t inherited on all of my old comments. Of course, that makes me sad and annoyed
Decisions, decisions…
Ricardo Bueno recently posted 12 Warning Signs It’s Time To Invest In A Professional Website Design
Having the same problem. I wonder if Disqus provides a similar feature. Some great ideas in this post though!
Brittany Rubinstein recently posted Skiing for Techies
Disqus does have a feature to integrate Analytics (http://docs.disqus.com/help/60/).
Disqus might be simpler – check out this entry on their knowledge base. http://docs.disqus.com/help/60/
Great help from this blog! Thanks a lot for the information I needed
I’m one of those people who never really though blog comments could be so valuable, but now that I think about it I realize that people who take the time to comment would probably be interested in interacting with the site in other ways too. It’s a really good idea to have a Thank You page just to let them now how much you appreciate the contribution and to show them some of the other areas where they can post comments/content or subscribe to updates.
If I started doing this, then of course I’d want to set it up as a GA goal.
Techie @ Kindle Review recently posted Increasing Android Battery Life
This is AWESOME! I’ve never even thought of utilizing the “goal” feature in analytics let alone customize it like this. Although i might not use this for comments (my blog doesn’t get any comments)… I’m definitely going to explore the goal feature for analytics. Thanks!
Chris @ Austin Home Search recently posted How To Search For Austin Homes & Real Estate
This is great advice and a lot I can delve into. I am addicted to checking my analytics but don’t have enough traffic to really get to experiment much with all the options. Will keep this post bookmarked for a future resource when I have enough data to really do much. Thank you for the geeky yet informative post.
Cindi F recently posted Boys & Girls Clubs in Indian Country
Hey Kristi, I was planning to set up a Thank you page in WP, but was not getting the desired easy and simple steps for doing so. Thanks for your tips on the same! Using thank you page for first time commentators is a good idea. I tried implementing your first method of using comment redirect plugin and found simple as you have posted all the steps in a well structured manner. Thanks!
Hello Kristi! What an amazing post. I would like to say thank you one more time for the excellent work you’re doing. Repeated reading is highly recommended for this kind of posts. I am surely going to bookmark it. You really inspired me to set some goals for my blog, too.
Nick@Outdoor Gear Reviews recently posted Sierra Trading Post Coupon and Review
Very cool idea. I would have never thought of tracking it that way. Hope all is going well with the band!!
Larry
Larry Lourcey recently posted Put Some WOW In Your Portraits
Yes – will you be touring in Texas in 2012?? You know Larry and I will be first in line to buy tickets.
::punches Larry in the arm and falls down giggling::
She’s a good sport AND an excellent writer, this Kristi Hines.
Holly Jahangiri recently posted Good Blogger And A Good Blog: What Are The Signs?
Thanks Holly!
All is well Larry, lol.
It seems to be like a marvelous tutorial for all bloggers and for beginners. I’m sure that the majority of this post’s readers will follow your advice and check it in practice. and as a result the number of your fans will grow immediately
Amanda@BuySellWordPress recently posted Fashion WordPress Themes
Really Nice post! Liked it!
Sagar Sharma recently posted Google unifying & rolling updates on its privacy policies and ToS
Holly is sooo right ! This IS a manual, and a much needed one at that. I had no idea this was even an option with Google Analytics. Very interesting and something I should consider. I use WordPress and Google Analytics but I am not that sharp on all the advantages and plugins. Kristi, thank you so much for taking the time to share this information with us. You might consider packaging this article as a pdf download or an e-book. Cheers !
Chris@Phoenix Tree Trimmer recently posted Tree Trimming in Mesa
Great tutorial! And I think it is perfect both for newbies and for more experienced one. After all we study during the whole life:)
Anna recently posted temporary veneers
I have tried this and must say it works but I rarely use google adsense and instead I use Getclicky so I am trying to figure out how to do this in it… Any Idea ?
Vineet recently posted Turn your Laptop into a Wifi Router Hotspot : Mhotspot
I’m not familiar with their system, but if you can set up goals with a URL destination, method #1 should work for you. It looks like they do according to this post (http://getclicky.com/blog/270/important-change-to-goals) but they’ve made changes to it.
I have used Google analytic for opt-in page testing. It’s really a good an unique idea to add it for blog commenting. It didn’t even occur to me until I came across your post.
This is impressive will try it out.
I was wondering, do you know a way to still track goals without having a separate blog comment thank you page? (with out the redirect page)
Shamelle@Better Blogging Ways recently posted 7 Twitter Retweet Tweaks To Encourage Others To Retweet You On Twitter
Hi Shamelle. Try Method #2 in the post – it allows you to add the GA code to the submit button, so the goal is triggered when someone submits the comment without having to go to a thank you page.
Thank you for this manual Kristi. I have to read it carefully once again to implement it. Wonderful post

Chitra@SocialVani recently posted Don’t Be Evil: SPYW Tweaking Bookmarklet
Advertising and SEO can get you customers. Comments and conversations from the comments can create a relationship. Without relationships, there is no business. Thanks, Kristi for your thorough instructions.
David Sneen recently posted How to Earn $57,600 a Year!
Kristi,
Great post and pretty handy too. Will this WP plugin work with Disqus?
This doesn’t work with Disqus unfortunately. It looks like their way might be simpler though – http://docs.disqus.com/help/60/
I love the idea of a thank you page for commenters. I set it up along with the Comment Redirect plugin, but I should have read this comment first. I have Disqus comment system on my blog so I guess the redirect won’t work.
Here’s a tech question for you…what happens if I switch from Disqus to CommentLuv? Do my existing comments get messed up?
Denise Wakeman recently posted 13 Steps to Creating Your First Kindle Ebook
This is one of the most detailed and exhaustive posts on the web that I have seen. Wonderful. I’ve never used goals in Google Analytics though I noticed it many times. An excellent tutorial on that.
Ashok recently posted Windows Defender Offline to remove malicious unwanted programs
It really is amazing how powerful Google analytics is, Goals combined with regular expressions can give you lots of powerful data. And as seeing in this article you really don’t need to be selling anything to use the power of this tool.
Nishadha recently posted Grow Twitter Followers Using Software