Obstacles to Tracking Conversion in Google Analytics
Tracking conversion is a critical component to understanding how your search marketing campaigns are performing.  Whenever I start helping a new client with web analytics, I map out a thorough strategy so we can easily identify high performing channels, campaigns, and keywords. Unfortunately, I know there are many companies launching a wide range of campaigns without going through this process.  And if you dont effectively track conversion, you run the risk of flying blind.  And flying blind is a dangerous thing to do in online marketing.

In Google Analytics, there are two core ways to track actions that you deem important on your website. First, you can track these actions as conversion goals and then tie conversion back to specific traffic sources, campaigns, or keywords.  You can view conversion goals in Google Analytics via Goal Set tabs in your reporting (see screenshot below).  The second way you can track specific actions on your website is by using Event Tracking.  Using Event Tracking, you can identify when certain actions are triggered on your site, while also providing more information about that event (via parameters you provide in your Event Tracking code).   Which method you choose depends on a number of factors, and you can learn more about tracking conversion goals and events in Google Analytics in a previous post of mine.  Most of the tracking scenarios I develop for clients utilize a combination of conversion goals and events.  For the purposes of this post, Im going to focus on conversion goals.

Goal sets in Google Analytics

Also, if you are interested in learning more about developing a web analytics strategy, I cover the process in detail in my internet marketing ebook titled Taking Control of Your Online Marketing.  There is an entire chapter covering how to track your online marketing efforts via Google Analytics.

Obstacles to Tracking Conversion
If you have completed the process of developing an analytics strategy, youll be eager to start tracking conversion.  You probably have identified all of the actions you want to track, whether they are micro or macro-conversions, and how you want to track them via Google Analytics.  But, now you have to go and track them! This is when potential issues could arise.   As you take a hard look at how your site is coded, you might find that there are certain obstacles to tracking conversion.  For example, to track a conversion goal, you need to tell Google Analytics which page visitors will reach to convert.  Thats typically a thank you page after an ecommerce transaction or a form submission.  But what if there isnt a unique destination page that identifies conversion?  This scenario can, and does happen.  Actually, I see this all the time.  :)

Have No Fear, A Virtual Tracking Solution is Here
The good news is that theres often a way around limitations to tracking conversion.  Some are easy to implement and others are more complex.  Im going to cover an example of overcoming a conversion obstacle that is relatively easy to set up.  The technique listed below can save you from the flying blind scenario I explained earlier and can ensure that each marketing channel is trackable and accountable.  Note, this example uses the traditional Google Analytics snippet and not the new, asynchronous version.  Im using the traditional snippet in this tutorial since I know there are still many marketers who have not transitioned to the asynchronous code yet.  That said, the core concept remains the same.

The Dreaded Form That Posts Back to Itself
This is probably the most common obstacle to tracking conversion that I encounter.  There are times that a form or multistep process is coded in a way that the URL never changes.  For example, you might have a contact form which, once submitted, posts back to the same exact URL (and your developers can catch the form data when posted).  Imagine contact-us.aspx posting back to contact-us.aspx (the same exact URL).

Form postback and tracking conversion

One way around this common obstacle is to trigger a virtual pageview by tagging the html form code.  A virtual pageview is a page that you create (and name), that can be tracked by Google Analytics like any other page thats been triggered.  The page doesnt actually exist, but you can trick Google Analytics into thinking it was viewed.  Then, you can identify this page as the one that Google Analytics should track as the destination URL for a conversion goal.  Subsequently, you would enter the virtual pageview when setting up the conversion goal in Google Analytics.  I explain how to do this later in the post.

Heres how a virtual pageview works:
Someone fills out a form, clicks submit, triggers the virtual pageview, and then the form submission occurs like it normally would.  Google Analytics picks up the page and will report this pageview in your content reporting.  Since its picked up by Google Analytics, you can use the page as the destination URL for a conversion goal.  Awesome.  :)

How To Add The Virtual Pageview Code:

Original form element:
<form action="contact-us.aspx" method="post">
{form elements here}
</form>

New form element that triggers a virtual pageview:
<form action="contact-us.aspx" method="post" onsubmit="pageTracker._trackPageview('/vpv/contact/');">
{form elements here}
</form>

Important Notes: First, your Google Analytics snippet should be placed ABOVE your form in your html code.  You might have to move the snippet for this page.  Second, be aware that triggering virtual pageviews will artificially inflate your pageview count in Google Analytics.  This is part of the reason I added the /vpv/ subdirectory to the code above.  I can filter out those pages, when needed.

Conversion Goals – Adding The Virtual Pageview
Now that youve coded your form to trigger a virtual pageview, you can use that page as the destination URL when setting up a conversion goal.  Im not going to cover the step by step process of setting up a conversion goal in this post, but Ill show you how to add your newly created page as the destination URL.

While setting up a conversion goal, you have the option of choosing a Destination URL that Google Analytics can track to identify when conversion was triggered.

Conversion Goal Destination URL's in Google Analytics

This is where you can add your newly-created virtual pageview.  For our example, you can choose Head Match as the Match Type and then enter the URL as follows in the field for Goal URL:

/vpv/contact/

Once you save your conversion goal using the virtual pageview, Google Analytics will track conversion when it knows the page has been triggered.  Note, you can also use this technique for other tracking scenarios, like tagging a download, an email link, or any other link on your website.  For those situations, you would want to tag the link and not the form submission.  So, you would trigger the virtual pageview from the onclick event handler of the anchor tag.  Its a handy tactic that can help you track several types of actions on your site.

Finding a Way to Track Conversion
In this post, weve covered a relatively simple way to overcome an obstacle to tracking conversion in Google Analytics.  Unfortunately, there are many scenarios that can inhibit tracking on your website.  But its your job to find a way around those situations!  As mentioned earlier, flying blind is a dangerous thing to do in online marketing.  The good news is that you dont have to.  Map out what you are attempting to measure and then customize your analytics setup, if needed.  If you find a way to effectively track conversion, then you can gain incredible clarity into the performance of your marketing efforts.  Even simple changes can make a huge impact.

Glenn Gabe

Glenn Gabe is a digital marketing consultant at G-Squared Interactive and focuses heavily on SEO, SEM, Social Media Marketing, and Web Analytics. Glenn has over 16 years of experience and has helped clients across a wide range of industries including consumer goods, pharmaceuticals, healthcare, military, education, non-profits, online auctions, real estate, and publishing.

The Internet Marketing Driver

You May Also Like

14 Responses to “Overcoming Obstacles – How To Use Virtual Pageviews in Google Analytics To Track Conversion”

  1. Karen Scharf says:

    Thanks for sharing it here. This is a new piece of information to me. Sometimes virtual pages embed the most important conversion goal and may not be tracked. This results in wrong Analytics data and that can create a serious dent in your entire marketing campaign strategy. For managing campaigns perfectly every time accurate goal measuring system is essential.

  2. Glenn Gabe says:

    Thanks @Karen. Structuring a website properly from the start is definitely the best way to go (where you can accurately track conversion without using something like virtual pageviews). That said, there are many times that sites are developed in a vacuum and tracking isn't considered. That's when using something like virtual pageviews can save the day.

  3. Glenn Gabe says:

    Yes, you can use that virtual pageview as the destination URL for your conversion goal. The "page" will show up in your content reporting, and you can use that to trigger conversion. I hope that helps.

  4. Benjamin says:

    Hi
    Im trying to set a virtual page view on my site and i just didnt understand it much…
    I have a "get it now" button on my homepage and since the "goal" page is not in my site (its not the same domain) so i cant set it as a goal,so i wanted to set as a goal,the "get it now" button,when someone is clicking on it so i would like to know and see it to understand what is my CTR…
    can you please give me an idea how to do that?

  5. Deniz says:

    Hi Glenn – great post.

    Just trying to implement VPVs for the example you explained (no unique url after form posts), but have a scenario whereby the url returned needs to have the transaction amount for affiliate reporting.

    Is this possible?

    Thanks!

  6. [...] Overcoming Obstacles – How To Use Virtual Pageviews in Google Analytics To Track Conversion – SEP [...]

  7. Liz says:

    Thanks for the great article. I have not had to use pageviews much to date, but a new client's website means that they use virtual pageviews throughout the conversion process, on each "Next" button. On the thank you page, there is no "Next" button. My question is, can you use virtual pageviews without an event? Could you just include the virtual pageview name in the main GA code, eg:

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXXX']);
    _gaq.push(['_trackPageview''/vpv/thankyou/']);

    Or something similar? I hope this isn't a dumb question- just trying to get my head around this as a non developer! :)

    • Glenn Gabe says:

      Hi Liz.

      If you are sending visitors to a thank you page, then that's the destination URL you should use for your conversion goal. When visitors reach that page, it tells Google Analytics that the user "converted". They don't necessarily have to click to another page to convert (GA-wise).

      Also, you can use buttons or links to trigger virtual pageviews, which can be used as destination URL's for a conversion goal. I couldn't tell if you knew that based on your comment, but wanted to make sure I explained it. For example, if a form posts back to itself or if you have an AJAX-style form that doesn't push visitors to another page.

      I hope that helps.

      GG

  8. Liz says:

    Thanks Glenn. I probably didn't make it clear that they can't use a set URL as the thank you page, due to the way that the site is set up- the url is dynamically generated to track certain values through to their booking system, so it has different variables in each time. As well as this, if they used the same thank you page, all the different goals in Google Analytics (products) would have a conversion added to them, although they are different goals / products.

    So it isn't possible to put a virtual pageview on a page *without* an event like a button? Or is a virtual pageview always an "onclick" or "onsubmit" event?

  9. Liz says:

    Sorry to keep writing all over your comments! :) For anyone else having the same issue as me, I have had it confirmed that yes, you can call a virtual pageview without it having to be an onclick event, by modifying the first call to track Pageview, as in the code above. Phew!

  10. Keesjan says:

    Hi, great post.
    Do you know of a way to NOT measuring incomplete forms. IN your example the VPT is called on the submit button.
    But what when people:
    filled the form incomplete,
    click submit,
    get a message that tell them to complete the form
    and submit again.

    Then 2 VPT conversions are made?

    • Glenn Gabe says:

      Thanks for your comment Keesjan. The code I used only triggers when the form submits. If you validate before submission, it shouldn't trigger twice. Also, conversions are session-based, so it would only calculate that conversion once for that user session. I hope that helps.

  11. Dan says:

    Thanks for the post. Is there any potential SEO impact of using Virtual Page Views? Can it slow site speed? Any do's and don'ts to avoid these kind of negative impacts?