I'm working on a site that uses Google Analytics. On most of the pages the default call to _trackPageView() that records the page view in GA using the current URL works just fine. I can add that code to a master page so it is included on each page.
However, under certain circumstances I want to override the name of the page that gets recorded in GA. For instance I may have a single page that has multiple steps and want to record them as separate pages in GA. The _trackPageView method works fine for this but I'm not sure of the best way to incorporate it into ASP.NET. I don't want to handle the logic of rendering the call to _trackPageView on each page.
I'm thinking that I either expose a property on the master page (something like OverrideGAURL) that if present is inserted into the call to _trackPageView or wrap the GA script rendering into a user control that has a method or property exposed to override the default rendering.
Has any done something similar or have suggestions on the best way to approach this? My main goal is to encapsulate the GA script rendering and be able to override the page name with just one line of code in the code behind or by setting an attribute.