views:

26

answers:

1

On my site I have a form that spans 2 steps each step 1 posts back to the same page and loads the second part of the form. The only difference between step 1 and step 2 in terms of URL is an anchor text in the url

e.g.

STEP 1 : www.mysite.com/enquiry/ STEP 2 : www.mysite.com/enquiry/#message

is it possible to track these in goal funnnels? If not would i have to hardcode some tracking paramater into the GA code?

A: 

_setAllowAnchor(bool) won't solve your problem. If I'm not mistaken, the whole point of it is to have it accept utm variables that won't appear in the Content section of GA (keeping your data more canonical and uncluttered)

This is hard to do reliably cross-browser without something like jQuery.

You'll need to include a plugin like this to deal with past IE problems: http://benalman.com/code/projects/jquery-hashchange/docs/files/jquery-ba-hashchange-js.html

The following (untested) script should attach a function to a cross-browser compatible hashchange event, and then create a 'false' pageview to allow you to track it separately in Google Analytics.

    <script>
jQuery(document).ready(function($) {
   $(window).hashchange( function() {
       var fakeurl = location.pathname+location.hash.substring(1);
       fakeurl = fakeurl.replace("//","/"); //fix browser quirks
       _gaq.push(['_trackPageview',fakeurl]);
    });
});
 </script>

This should have wider compatibility than some of the other options.

In GA, in your stated example, the 'anchored' page will track as /enquiry/message.

yc
So to link that to my goal funnels would i put the steps as followsstep 1 : /enquirystep 2 : /enquiry/message?
Yes, that's right.
yc