A recent challenge came up recently with TKG’s custom Content Management System, Apoxe. As the “chief” developer of Apoxe, it was both interesting and educational to me to see just how flexible Google analytics can be with collecting data.
First, a little background of Apoxe. Our CMS contains logical folders of pages but does not show that structure in the address bar. This simply means that as an admin of a website, you are able to nest pages under pages and create the following navigation structure of “Web Development” -> “Lead Generation Websites” -> “Manufacture Websites” shown below:
The end user is able to then land on the “Web Development” page, see the “Lead Generation Websites” in the navigation, click it, and then see “Manufacturer Websites.” This series of clicks however does not reflect itself in the actual URLS:
Instead of something like:
This lent itself to a potential problem for a client recently who wanted to track traffic in a specific area of their website using Google Analytics. If “/web-development” was part of every URL in the “web-development” folder that task would be easy. After exploring a number of different options ranging from a ton of 301s, to modifying how our CMS builds its URLs, to calling each other names, we discovered that Google lets us pass it our own data called “Custom Variables” that Google then uses as way to setup custom filters. From the instructions, we were able to name a variable, then simply pass it a value.
What value could we pass that would be both dynamic, and constant across all sub-pages for a given section? That’s easy – the link text from the second link in that pages bread trail.
This series of links showing where you are in the site are built from Apoxe’s logical folders and any page under that branch will always contain the same value as its “starting point.” A solution that is simple, elegant, and future-proof? We call that an all-around win.