Increase revenue from Joomla Websites

Analytics for Joomla provides resources to optimize and get insights for Joomla websites without knowledge of HTML

Tracking comments in Jcomments with Google Analytics

Comments are important to track on a blog. They are an important way to track if your readers are engaging with your website or blog. For Joomla, there are many components which offer comment systems for your Joomla websites. One of the most popular comment components is Jcomment by JoomlaTune. Here is how you can track comments in Google Analytics when you use the Jcomment component. To use this instruction, you will need to have Jcomments installed. You will also need access to the files of your Joomla website (preferably by FTP). We have focused our instruction on the latest version of Jcomments, v2.2.0.2. Instructions may vary on different versions of the component.

1. Finding the right file to edit in Jcomments

You will need to find the template of the form that posts comments. The file is called 'tpl_form.php'.

You can find the file in this folder of your Joomla website: 'components/jcomments/tpl/'.

2. Editing the file to track posted comments

In line 49 you will find this code:

<form id="comments-form" name="comments-form" action="javascript:void(null);">

You will have to replace this line of code with:

<form id="comments-form" name="comments-form" action="javascript:void(null);" onSubmit="_gaq.push(['_trackPageview', '/tracking/comment-submit']);">

Once you have made this change, you can save it and upload the new version of the file.

3. Setting up a goal in Google Analytics

  1. Login to your Google Analytics account.
  2. Click edit next to the profile name you want to add your goal to
  3. Click on 'add new goal'
  4. Add a description to the goal and add this line to the goalurl field: /tracking/comment-submit
  5. Save the goal
That's it! You will now be able to track the amount of comments you are getting on your Joomla website with Google Analytics.

Share your comments