Virtual Page Tracking and Goals with Google Analytics
Sometimes I come across websites that don’t use RESTful URLs or have too unique (with an order number) URLs during checkout and I need to implement Goal Tracking in Google Analytics on these user interactions. I’ve also had to implement Goal Tracking in a non-ecommerce web application where tabbed on-page browsing guides users through a 3-step process. Examples of situations that pose challenges to traditional page tracking in Google Analytics include:
- Throughout Interchange’s checkout, URLs are posts to “/process”, which makes the user interactions difficult to distinguish.
- Throughout Spree’s checkout, URLs are posts to “/order/:id/edit”, which are distinct and can be difficult to aggregate.
- In a Sinatra application we developed recently, the single page URL is “/locate.html”, but tabbed browsing occurs through three unique steps.
Google Analytics Tagging
To add Goal Tracking by URL, pages must first be tagged as “virtual pages”. To implement virtual page tracking in Google, it’s as simple as including a new virtual page URL in the _trackPageview action:
In the cases I described above, here are the tags used for each:
On a three page checkout process, the following virtual pages were tagged:
On a multi-page checkout process, the following virtual pages were tagged:
On a three page process, the following virtual pages were tagged:
After tagging is complete, you’ll need to define a Goal in Google Analytics to begin tracking it.
Looking at the Data
With virtual page tracking and goal tracking, you can see how many goals have been completed during a certain time frame:
You can also compare regular segments of traffic: e.g. users that found your site through search versus referrals:
You can compare advanced segments of visitors: e.g. marketing campaign #1 versus marketing campaign #2. This type of comparison may give you more actionable metrics to determine which marketing campaign to put more resources into.
Last but not least, you can visualize the funnel of conversion to see where you might be losing customers. This might also be actionable in that you may be able to A/B test checkout process (or another type of conversion) changes to improve conversion.