Analytics Tip: Setting Goals for Self-Loading ‘Contact Us’ Pages – SEO Hong Kong


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.


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’.


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">


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


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


Trackback URL:

Leave a Reply

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