Five Techwe are
Jul 25, 2011

Tracking Dynamic Sites and Pages with Google Analytics

If you have a website that has dynamic content or has multiple pages and steps under one URL (or an all flash website), you have to do a little more work to get Google Analytics to effectively track your pages.

For example, many of our e-commerce sites feature a shopping cart that has multiple steps (Address, Shipping, Payment, Thank You) and one URL (/shopping-cart/). Regardless of which step you are on, Google Analytics will track this page view as /shopping-cart/. Without some additional tracking, you cannot establish a funnel or tell where people left the shopping cart process.

Although you have to add a little bit to your Google Analytics code to track these pages properly, it is not very difficult to do.

The Code

Assuming you are using the asynchronous version of Google Analytics, the key is to find this code in your Google Analytics:

_gaq.push(['_trackPageview']);

And change it to:

_gaq.push(['_trackPageview', '/shopping-cart/address/']);

This tells Google Analytics to track this page view as /shopping-cart/address/. This will not change the actual URL, it only changes it in Google Analytics for tracking purposes. Create this code and place it in the template for each page or step you want to track.

This is all you need for Google Analytics to track these dynamic pages or steps as individual pages. After this is set up, you’ll start to see page views come in as the URLs you set.

Creating A Funnel

You can also create a funnel using these new URLs and it is done the same way as you create a funnel for any group or URLs.

For help on setting up funnels, visit Google Support for additional information.