Categories: Google Analytics

Reporting Accurate Funnels in Google Analytics

Sometimes, the urls (and titles) of your pages are not conducive to web analytics reporting. For example, your ecommerce site’s payment, shipping, and order confirmation page may all have the same url for some reason – . To web analytics, all these funnel pages are reported as one page. You are now stuck, you can’t create ecommerce funnels and measuring shopping cart funnel abandonment is impossible. And there is a more subtle and serious issue as well, in your report, you may find hits (events, ecommerce, social, etc) associated with this url, but you won’t know what part of the order process these hits belong to.

Here’s the actual flow we want to track and understand:

If you have a shipping calculator on your shipping page, a card type drop-down on the payment page, social buttons on all pages, you want to track each of these events on each page. However, it will show like this:

All the urls are the same! How do you know if these events happened on the shipping page, payment page or order confirmation page? You might be able to tell from the event names, but in some cases you may not be 100% sure, and this is definitely not clean and ideal.

While fixing the actual real urls and title tags (assigning unique urls and titles per page) would make things very organized, your content management system may not support this, or you might prefer not to spend that time or money on developers.

Luckily, there is a secret, undocumented method that allows you to actually set the page url and title of a visited page in Google Analytics. More importantly, it will actually associate the hits with these new, more meaningful page urls and titles. Your reports will be easier to read and will provide insights that may not have been available before.

The Issue With Virtual Pages

The traditional solution to this would be to use the _trackPageview method and trigger virtual pages for each “step” (i.e. /virtual-page/shipping.html, etc.).

_gaq.push(['_trackPageview', '/new-meaningful-url.html']);

The drawback here though is still, the actual events will not be associated with these virtual pages you’ve created. They will always be connected to the “real” page, which would be /checkout.aspx (as you can see in the screenshot above). You’re still lacking potentially valuable insights.

SECRET HACK! Setting the URL and TITLE in Google Analytics – _set method

With this new _set method, you can manually set the url and title of the page to whatever convenient name you want.

  _gaq.push(['_set', 'page', '/new-meaningful-url.html']);
  _gaq.push(['_set', 'title', 'New Meaningful Title']);

Simply push the new page’s title using _set method before calling your _trackPageview

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_setDomainName', 'e-nor.com']);
  _gaq.push(['_set', 'page', '/new-meaningful-url.html']);
  _gaq.push(['_set', 'title', 'New Meaningful Title']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

In the case of the ecommerce example mentioned earlier, for each page you’d like to rename, you can pass the preferred url and title so that it’s separated and meaningful in Google Analytics and associated WITH THE HITS:

_gaq.push(['_set', 'page', '/shipping.html']);
_gaq.push(['_set', 'title', 'shipping page']);

OR

_gaq.push(['_set', 'page', '/payment.html']);
_gaq.push(['_set', 'title', 'payment page']);

OR

_gaq.push(['_set', 'page', '/confirmation.html']);
_gaq.push(['_set', 'title', 'order confirmation page']);

You’ll be able to see events and figure out things like “Did they abandon the cart at the payment page? At the shipping page? What are they clicking on the order confirmation page?” etc.

What do you think? Share what other use cases you might have in mind.

Ahmed Awwad

Analytics Team Lead - Implementation Ahmed is a technical guru with 15+ years of experience in Web Technologies, Digital Analytics and Digital Marketing. Although he comes from a background of physical education, Ahmed is self-made achiever who is diligent in his pursuit to adapt new technologies and translate them into unique user experiences for some of the world’s most recognized brands.

Share
Published by
Ahmed Awwad

Recent Posts

Google Delays Third-Party Cookie Deprecation to 2025

Google announced on April 23 that it will again delay third-party cookie deprecation (3PCD) in…

6 days ago

Understanding Funnel Reports in GA4

Funnel reports have long been one of the most actionable reports in a marketing analyst’s…

1 week ago

GA4 Monetization Reports: An Overview

GA4’s Monetization reports provide organizations with simple but actionable views into the revenue-generating aspects of…

2 weeks ago

This website uses cookies.