Hi I am working on a website and need to setup goals on a registration form. The registration form has many stages and many URL's but as the # is within the URL, for example: These are the URL's as you go through the form: Step 1 https://www.example.com/instructions/purchase#form-top-1 Step 2 https://www.example.com/instructions/purchase#form-top-2 The goals have been setup, but Google Analytics is not tracking what is happening on these URL's. I am assuming this is to do with the # tag. I've had a read around virtual pageviews and I am not sure whether this will help with this issue? Please help! Thanks
Since you are using named anchor tags to quickly link to specific forms on a webpage. In Analytics, this will trigger a pageview for /instructions/purchase by default – not for /purchase#form-top-1 or /purchase#form-top-2. Google Analytics do not track anchor tags by default, in order to track them separately, you will have to use location.hash tag in your analytics code: Old traditional tracking code: var pageTracker = _gat._getTracker("UA-XXXXX-X"); pageTracker._trackPageview(location.pathname + location.search + location.hash); New asynchronous tracking code: _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview', location.pathname + location.search + location.hash]); Hope this would help you
Would the same rule apply for tracking #tags for multiple page use? i.e. if you had affiliate url's pointing to the same page? Thanks