• Home
  • New Entries
  • Popular Entries
  • Submit a Story
  • About

How To Track Wordpress Signups and Comments With Google Analytics ...

I’m sure you have heard of Google Analytics which enables you to track the behaviour of a site.  The key to success with Analytics is using website goals.  This allows you to conveniently measure the success of your website to criteria you dictate.  For a blog (for me), 2 goals would be a user registration - and a user posting a comment on a page or post.  For this, we need to ensure tracking is on all appropriate pages and that the goals are correctly configured.

If you haven’t already - you should be using the new Google Analytics code (which looks something like the following).

    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src=" + gaJsHost + "google-analytics.com/ga.js
    type= ext/javascript\%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-XXXXXXX-X");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>

The new version has many new features (which I am not going into in this post) - but it allows you to use a function we need to track blog comments (namely an onclick event).


Install Google Analytics

Firstly, make sure the Google Tracking Code is on all pages.  You can do this by editing your themes footer.php file.  Simply paste the Google Code before </body>.  But you’re not done yet.  You need to edit wp-login.php.  Search for </body> and before every instance add your Google code here too.  This will put tracking not only on your blog contents, but also registration and various front end forms too.
Configure Goal Tracking For Blog Registrations

You are now ready to configure Google Analytics to track goal actions on your blog.  To start with, we will setup the goal for a user registration.  Remember the additional code we added to wp-login.php?  This is where it comes into use.  Create a conversion goal based on the screenshot below.  I always give a goal conversion like this a value of 1 - due to reporting and keyphrase / traffic reports - which assigns a calculated money value field to various keywords and traffic sources to work out profitable items.

To make sure this goal is only counted when people register (and not just visit the page), add the following funnel configuration too;

There we have it.  If you leave this goal running for a while - you will be able to see exactly what keywords / traffic sources are driving registrations - and infact - whether your registrations are growing or falling…


Configure Analytics For Blog / Page Comments

The new version of Google Analytics allows us to track onclick events.  Every comments box has a submit button or image.  We can track when this button is clicked using Google Analytics.  To get your head around this concept, we setup what we call a virtual page view (a page that doesnt actually exist - the submit button) and we link this virtual page view to a goal in Analytics.

The first thing to do is edit your themes template file - namely comments.php.  Unfortunately, you will need a little bit of HTML knowledge to find the HTML code for the submit/image button.  Once you have located this, add the following code to the input object;

    onclick=”javascript: pageTracker._trackPageview(’/goal/wordpress.html’);”

Thats it! Now - everytime the submit button is pressed on the comments form - analytics will log that /goal/wordpress.html has been visited.  This leaves the logical conclusion to add a goal conversion to this page.  See the screenshot below on how to do this;

analytics comment goal

All done.

Thats all there is too it.  You have now setup goal tracking on your wordpress blog.

 

 Original Source:
http://www.tdcreative.net/blog/how-to-track-wordpress-signups-and-comments-with-google-analytics/

AddThis Social Bookmark Button

Posted at 12:50:42 pm | Permalink | Posted in Wordpress Tips  

Related Stuff

Google Buzz Button Wordpress Plugin Released

If you are looking for a Google Buzz button to add into your Wordpress site then we have released the first Wordpress plugin exclusively ...

Plug And Play Ecommerce With Wordpress Plugins

Since 2003 Wordpress has slowly been gaining popularity amongst the elite of the internet, the bloggers. It is one of those few things ...

Add Google Search to Your WordPress Blog

The native WordPress search does not return very relevant results, thus it makes a lot of sense to add Google Search into your WordPress ...

Add More Sidebars to Your WordPress Theme

You can add more than one sidebar section to your WordPress site. For example, with the stc-intermountain.org site, I added a whole bunch ...

Series Posting in Wordpress

In my functions.php file, I have some code which implements series posting. This relies on the thematic ...

Top Stuff

Free Blogger templates Anime Themes

Wordpress Guestbook Generator Plugin

48 Unique Ways To Use WordPress

GeekLog

WordPress Single Post Templates

Get The Image WordPress Plugin



About Webloglines

Webloglines is a project offers a comprehensive collection of blogging services, articles, themes and plugins from around the world. Whether you're looking to promote your own blog or find blogs on various topics, this site is for you.


Search


Topics

  • Adsense (12)
  • Blogging Tips (73)
  • Blogs Slides (25)
  • Blogs Websites (22)
  • Digg (20)
  • How to Blog (129)
  • Search Engines (9)
  • SEO (135)
  • WordPress Plugins (269)
  • WordPress Security (75)
  • Wordpress Themes (99)
  • Wordpress Tips (162)

© 2006 www.webloglines.com. All Rights Reserved. Powered by IRange