Welcome to Alledia, the Joomla SEO Experts

Here at Alledia we provide you with advice and extensions to rank your Joomla! sites high in search engines such as Google, Yahoo and MSN.

You can read the most popular Joomla blog, join the Joomla SEO Club, check out our SEO-friendly Joomla template or attend a Joomla training class.

Home / Blog / Joomla Tips And Tricks / Google Analytics Goals in Joomla

09

Oct

2007

Alledia.com Blog

Google Analytics Goals in Joomla

Joomla Tips And Tricks
Written by Steve Burge   

One problem ... if you're using a shopping cart, goal-tracking is relatively simple but Joomla doesn't make it easy to set up goals when you're generating leads via contact forms.


Goals require people to land on a single page, but lots of contact and enquiry forms simply reload on the same page. So to set up a goal, we'll need to hack the form we use and send people to a single page. Its going to have three advantages:


  1. It'll allow the creation of goals that we can define in Google Analytics.
  2. People get confused by the Joomla contact forms as they are now. Its so easy to miss that very small "Thank You" at the top of the page
  3. You can use the landing page for much more than just the tracking code. Its a great place to advertise products and try to upsell.


Here's a few examples of how to set up a single landing page:

Default Joomla Contact Form

Look in components/com_contact/contact.php. You'll need to change line 456: 


$link = sefRelToAbs( 'index.php?option=com_contact&task=view&contact_id='. $contact[0]->id .'&Itemid='. $Itemid );


Replace the URL with the address of the page you want to send people to. Check out an example by sending us a quick email.

Hot Property

Look in components/com_hotproperty/hotproperty.php. You'll need to change lines 527 to 531. Simply look for this code repeated three times:


<script> alert("<?php echo _HP_CONTACT_THANK; ?>"); document.location.href='<?php echo sefRelToAbs("index.php?option=com_hotproperty&task=view&id=$id&Itemid=$Itemid"); ?>'; </script>


Replace the URL with the address of the page you want to send people to.

Community Builder

It has a setting that allows you to send first-time registered users to a specific page.


Go to Components >> Community Builder Configuration >> Registration >> URL for first login visit

Further Reading


Comments

(2)Add Comment
David Towers
Good Web Practices
October 11, 2007

I look forward to the possibility of a similar hack in Joomla 1.5...

0
paulwithap
February 20, 2008

This is a great help, thank you. How can I apply this technique to the letterman component? Thanks.

Write comment

 
  smaller | bigger
 

busy