Virtual pageviews in Google Analytics
It happens that for a technical reason, two pages of our site have the same URL. This is often the case for an order taking process or for a confirmation page. In this case, how to distinguish them in Google Analytics? How to create a navigation path for a checkout process if the URL of the billing page is the same as that of the shipping page?
A first solution consists in changing the URL of these pages. If it were so simple, this post wouldn't be relevant… To avoid a fight with the IT team responsible for the site, opt instead for the solution of virtual page views.
THE THEORY
Let's analyze the Google Analytics tracking code (GATC – Google Analytics Tracker Code ) to understand what a virtual page view is:
The line that interests us here is the one that registers a page view in Google Analytics. It is the _trackPageView function which is responsible for this work. Each time this function is called, Google Analytics records a page view. By default, the function retrieves the URL as it appears in the browser's address bar and saves it.
By specifying a parameter to the _trackPageView function , GA records a page view by replacing the page URL with the parameter value. In short, it generates a virtual pageview .
THE PRACTICE
Let's take the example of the checkout process on an e-commerce site as follows, with corresponding URL:

To distinguish the Billing, Delivery and Summary stages, simply change the line that registers the page views in the GATC. For instance:
- Billing
pageTracker._trackPageview('/checkout.asp/billing'); - Delivery:
pageTracker._trackPageview('/checkout.asp/delivery'); - Summary:
pageTracker._trackPageview('/checkout.asp/resume');
And There you go! Now all that remains is to use these virtual URLs to configure a corresponding goal in Google Analytics and analyze the abandonment rate at each of the stages…

Share this
You May Also Like
These Related Stories

Design an ergonomic homepage
The homepage is usually the most visited page of a website. It is often the first page that we consult and if this is not the case, we generally return quickly to the home page to explore a site. Much like a storefront, the homepage gives a first impression of your site and directs the potential buyer. Here are the basics of a well-built landing page that respects conventions.

New Facebook Pages: Understanding the Timeline for Your Brand
On March 30, your company's Facebook page will change forever . The timeline format will be mandatory for all business pages. However, this format has been implemented for users for a few months now. It shocked millions of Facebook users when it launched, and now it's brands' turn to embrace Facebook's changes and adapt to their new realities. Here are the important points to be ready for change!

When Changing a Button Gets You $300 Million
It was in the middle of a brainstorm with Vigeant and LD that we debated on the optimal process in the management of forms, in particular the information that we should request from a client during his first request for content, and also on the type of content requested. That's when Vigeant came along, like Zorro, with this information worth $300 million .
Repérer et valoriser ce qui compte vraiment.
Recevez nos analyses et conseils pour rester à l’avant-garde du numérique.