SEO Hong Kong | HK Search Marketing and Optimization Blog

Google

Analytics Tip: Setting Goals for Self-Loading ‘Contact Us’ Pages

Setting up goals is one way to objectively measure engagement level of a website over time, while serving as a diagnostic tool to identify areas of concern. One common goal to measure is the ‘contact us’ form. This is a form where visitors can send inquiries, complaints, or any message to stake holders of the website.

Setting up goals in Google Analytics is relatively easy: identify the URLs of pages where visitors must access to complete a transaction. It may be three or four steps for a shopping cart or a click away if you’re measuring whitepaper downloads or newsletter subscriptions. Going back to the ‘contact us’ page, it is also pretty straightforward, just fill up the form and press the submit button, you have one website engagement waiting to be measured.

contact-form

However, there are instances where the ‘contact us’ form also shares the same URL as the thank you page — the page generated after you click the submit button and symbolically accepts the message with the ‘Thank you for your message. We will get back to you soon’.

goal-setup

For goals to be effectively setup, Google Analytics must be able to correctly distinguish two pages as different, ‘contact us’ form and ‘thank you’ page. If you have a ‘contact us’ form and ‘thank you’ page, you’ll be fine to proceed setting up the goal (see screen grab of the setup screen above). Otherwise, we need to do a bit of customization. Since a goal is really just pageview instance, we to simulate a pageview using simple Javascript. We can do any of the following:

a) Place the following code on the supposed ‘thank you’ page. This creates a new pageview instance different from the ‘contact us’ form page. Also, the tracking code must be placed above this code so necessary parameters are set before Google Analytics will read the new code we incorporate onto the page.

<body onload="pageTracker._trackPageview('/ContactThankYou');">

I guess it’s quite a challenge to take this suggestion simply because the page in question serves both ‘contact us’ and ‘thank you’ pages. So unless you’re willing to do some IF-THEN condition to load the <body> tag, it’s tough to use this.

b) Another method is to integrate the same code right at the moment the submit button is pressed. At the ‘contact us’ form page, the submit button needs to be modified so that

<form action="[some script]" method="POST">

becomes

<form action="[some script]" method="POST" onsubmit="pageTracker._trackPageview('/ContactThankYou')";>

goal-setup2

Hopefully, this article is helpful in implementing goals using Google Analytics.

Comments

Related Posts

Elmer W. Cagape is an SEO consultant based in Hong Kong. Into Seinfeld, Toad the Wet Sprocket, space exploration, comedy films, digital marketing and travel. Follow him on Twitter (@elmercagape).

One thought on “Analytics Tip: Setting Goals for Self-Loading ‘Contact Us’ Pages

  1. Pingback: 60 Site SEO Audit Checklist

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>