One of the first things a new website owner wants to know is how people are visiting my site. Any statistics package can give you this information but my current favorite would be Google Analytics, it free, flexible and easy to use. Page views and bounce rates are not always a good measure of success. Plenty of people may visit the site but how many take action and contact you or sign up for the service you provide. This is where event tracking a little known feature of Google Analytics comes in it you to track actions your visitors take on your site and manipulate the results.
Basic event tracking can be used to track how many people click on a link that can't be tracked by Analytics such as
- downloading a file such as a PDF
- a link to an external site i.e. tracking exits to partner sites
- interaction with AJAX components of a site that do not reload the page
- actions generated from inside a flash component
- tracking conversions such as visitors submitting a contact form or visitors clicking on email links i.e. who has clicked on an email link and contacted be after viewing a page on my site and what page was that.
- tracking conversion types i.e. what topics are people contacting me about
- tracking conversion failure i.e. visitors who did not complete a signup form or when to a shop check out and did not complete the checkout
Of all the points I think the most interesting is tracking conversions and conversion failure. I will illustrate a common conversion that is of interest to most business sites, tracking contacts from your websites contact form.
Setup your contact form
For this example I have a basic contact form you may see on an accommodation site with a few fields Name, Email, Accommodation and Question. Obviously this can be any sort of contact form. I am going to extend the tracking to include what sort of accommodation the visitor was contact you about. You may say well I know already because they contacted me, however with Google Analytics you can easily segment these visitors and compare them against all your visitors or another segment.
Add the JavaScript to your form
In this example I am using the older Google tracking code as the demo site is setup with that. You can see in I have added some JavaScript to execute on the submit button click event. It includes in the Event Label field the value of the Accommodation dropdown. Doing this will allow us to compare the volume of enquiries of each accommodation type.
| table> |
| tbody> |
| tr> |
| td> |
| label id="LabelName" for="Name"> |
| Namelabel>* |
| td> |
| td> |
| input type="text" name="Name"/> |
| td> |
| tr> |
| tr> |
| td> |
| label id=" LabelEmail" for=" Email"> |
| Emaillabel>* |
| td> |
| td> |
| input type="text" style="width: 200px;" id="Email" name="Email"/> |
| td> |
| tr> |
| tr> |
| td> |
| label id="LabelAccommodation" for="Accommodation"> |
| Accommodationlabel> |
| td> |
| td> |
| select id="Accommodation" name="Accommodation"> |
| option value="Suite">Suiteoption> |
| option value="Studio">Studiooption> |
| option value="Hostel">Hosteloption> |
| select> |
| td> |
| tr> |
| tr> |
| td> |
| label id="LabelQuestion" for="Question"> |
| Questionlabel> |
| td> |
| td> |
| textarea id="Question" cols="20" rows="4" name="Question">textarea> |
| td> |
| tr> |
| tr> |
| td> |
| td> |
| td> |
| input type="submit" id="Submit" onclick="pageTracker._trackEvent('Form', 'Enquiry', Accommodation.options[Accommodation.selectedIndex].value);" |
| value="Submit" name="Submit"/> |
| td> |
| tr> |
| tbody> |
| table> |
| |
Upload your code and wait for some visitors to use your contact form or test it yourself. Once the data appears in Analytics you can start on the next step.
Create a segment of your visitors
This can be done by clicking on the Advanced Segments link in the left of Google Analytics. Create a new segment and give it a sensible name, in this case I’m using ‘Visitors with an enquiry’. Drag the event action from the left and drop it on the right and choose the condition ‘Matches exactly’ and then the value ‘Enquiry’ and save your segment.

View the report
You could create a custom report or customize the report on your dashboard. Expand the ‘Advanced Segments’ section on the top right of your main dashboard graph and select your custom segment ‘Visitors with an enquiry’ to compare.

You can now see a comparison of visitors vs. visitors who make an enquiry.

Extending to track failed conversions
I want to know how many people when to the contact page but did not use the contact form. We need to create a new segment to single out visits to the contact page. So create a new segment of visitors to the contact page. In a real world situation you may want to be more specific than just visitors to the contact page as someone may have gone there for a phone number. A better comparison may be those who have gone to the contact page and started filling out the form but not pressed the submit button. If so you would need to attach some JavaScript to trigger an event that occurred when a field was filled out then create a segment from that.

Comparing two custom segments
Again expand the ‘Advanced Segments’ section on the top right of your main dashboard graph and select your custom you want to compare.

You can now see the difference between your two custom segments the difference being the number of visitors that failed to be converted to leads. The same method can be used with steps to track conversion failure in an application form or shopping cart checkout.