Bit of a mouthful I know – but I spent hours trying to find this on the net, with little luck.  So I thought I would write a comprehensive article on how to solve this problem.  This article explains the process of setting up funnels for multiple conversion paths over different subdomains using regular expressions. It assumes you are already using funnels and are familiar with the basics of Google Analytics. If you are looking for a basic guide to setting up funnels, try here, if you are already familiar with basic funnel setups then read on!

What are funnels?

Funnels are a great way to visualize your visitors’ paths through your site, with the aim of completing a particular goal. Using funnels can help you identify usability problems in your site that need to be addressed in order to increase click through rates and ultimately conversion rates.

How to create a funnel across different subdomains

Example

mypointyhat.com wants to track visitors who land on a forum post at forums.mypointyhat.com and end up buying a pointy hat from www.mypointyhat.com/shop they then want to look at the funnel visualization for this particular behaviour.

Setting up cross subdomain tracking correctly

Before creating a funnel across different subdomains you need to ensure that you have setup the tracking on the site correctly. Firstly you need to check that the Google Analytics script is the same code on each sub domain with addition of a piece of code:

pageTracker._setDomainName(“.mypointhat.com”); (for example)

Once you have setup the tracking you need to setup an advanced filter, otherwise forums.mypointyhat.com/index.php and www.mypointyhat.com/index.php would both be treated as /index.php. To do this you setup an advanced filter and use the data shown in the following image:

Advanced Filter for Sub Domains

Advanced Filter for Sub Domains

Once these two things are done your pages will appear with their subdomain attached:

e.g. forums.mypointyhat.com/index.php and www.mypointhat.com/index.php instead of /index.php

If you need further instructions Google talks you through it here

How to create a funnel that works across subdomains using regular expressions

I’m guessing you have a funnel in mind, but for this one we are going to use the example I mentioned above. So essentially we want to track the funnel from forums.mypointyhat.com/thread/post-title through to www.mypointhat.com/shop/confirmation.php.

Regular Expression Matching

If you are not familiar with regular expressions, I suggest you do a Google search and do some background reading – once you understand regular expressions it gives you a whole new World of options to consider when trying to solve complex problems and arduous tasks.

The first point I will make is that in regular expressions a . (period) represents a character, therefore to get a . (period) to actually represent a . (period) you have to escape it before hand (so the program understands that it is a literal reference) the syntax for this is a backslash:

e.g. \.

Also please note, I haven’t tested my regular expressions in the example below, so they may not work – so no copying!!!

Bearing those points in mind our steps will look like the following:

The first part to setting up the goal involves activating the goal, setting the match type as regular expression, choosing the goal and the goal name (see image below for an example)

goal-settings-a

Step 1: forums\.mypointyhat.com/thread/[A-Za-z\-]+ Forum Thread (Required Step should be checked)
Step 2: www\.mypointyhat\.com/shop/index\.php Homepage
Step 3: www\.mypointyhat\.com/shop/products/[A-Za-z\-]+\.php Product Page
Step 4: www\.mypointyhat\.com/shop/basket\.php Basket Page
Step 5: www\.mypointyhat\.com/shop/checkout\.php Checkout Page
Step 6: www\.mypointyhat\.com/shop/payment\.php Payment Page
Goal: www\.mypointyhat\.com/shop/confirmation\.php Confirmation Page

Don’t forget to escape your periods!!! See the example below for a better illustration of where these URL’s go:

goal-settings-b

Now give it a day, if it doesn’t work you can check your funnel analysis and see where the problem is occuring. If you are still having problems check Google – if you STILL have problems – ask me on Twitter and I’ll do my best to help you :)

I must also give credit to Mr Mcskelly, who setup the cross subdomain tracking before I had to tackle the funnels on one of our client’s sites.

David Whitehouse

19 Comments

  • 1

    Thank you! I so needed this!

    Amanda

    22nd July 2009 @ 16:36

  • 2

    Thats ok Amanda, let me know if you need help with anything :)

    David Whitehouse | http://www.david-whitehouse.org/

    23rd July 2009 @ 08:02

  • 3

    If you’ve gone through all of this and still no joy then the Google analytics help forum is a useful source of expertise.

    @DaveN, have you taken the Google analytics individual qualification yet? It’s tricky but I’ve been using GA for a couple of years now and it taught me loads that I didn’t know – really useful.

    duncan bloor | http://www.getfamous.biz

    23rd July 2009 @ 11:33

  • 4

    [...] to new trends as they unfold. Timing is key in marketing. Don’t forget to monitor any tracking filters you have applied to your statistics too to make sure that they are working and picking up the data [...]

  • 5

    So how would the Funnels look for the Steps and how would the goal URL look? Just want to be sure, thanks. We don’t use regular expression matching. We set up everything else and are setting up the Goal now. Thanks again.

    Arturo

    29th July 2009 @ 19:27

  • 6

    It depends. If you are using subdomains then you would use the full URL (without http):

    e.g. http://www.example.com/goal.html

    But if you are using it on the same domain then you would use the relative address:

    e.g. /goal.html

    David Whitehouse | http://www.david-whitehouse.org/

    30th July 2009 @ 08:36

  • 7

    Ok, so if our goal is on one subdomain: /subdomain.main.com/index.php?a=new_account
    and our funnels include pages on the main site (not same as subdomain):
    /index.html
    /about.html
    /another.html

    then this is it how it should appear, as it works fine for us it seems. But what if another funnel includes another page on the subdomain? would we type in:
    /subdomain.main.com/newpage.html

    thanks.

    Arturo

    30th July 2009 @ 16:01

  • 8

    You should probably use the full domain name so instead of what you put, I would use:

    Goal: subdomain.main.com/index.php?a=new_account

    http://www.main.com/index.html
    http://www.main.com/about.html
    http://www.main.com/another.html

    But I think it treats both the same (I just prefer it that way as it removes any chances of confusion).

    If another page is included you would include:

    subdomain.main.com/newpage.html

    The fact you are putting a / before your subdomain URL’s leads me to believe you may not have added the domain tag:

    pageTracker._setDomainName(”.main.com”);

    to the Google Analytics script – am I correct? Just I have done this before and all the subdomains appear with a backslash before them…

    David Whitehouse | http://www.david-whitehouse.org/

    30th July 2009 @ 16:41

  • 9

    Thanks for explaining “funnel” the easy and more comprehensive way. But is the actual task of doing it as easy as your explanation?

    erotiske artikler | http://shop.nakenprat.com

    2nd August 2009 @ 04:05

  • 10

    Thank you for making it clear. I’ve been trying my hand on Google Analytics but has grown frustrated over time. But does regular expression matching make a world of difference?

    Advice for women | http://www.angiescouch.com

    4th August 2009 @ 05:38

  • 11

    Awesome. It looks like this is working. Thank you!

    I have only included the sub directory in where appropriate and used the full subdomain where neccessary.

    Thanks David

    harvey

    20th August 2009 @ 10:41

  • 12

    Hi David,

    I think I have a problem on my funnel – on stage 3 it keeps showing some progressing to stage 4 as normal, but also some “exiting” to stage 4. Why is it showing some of these as leaving when the URL they are going to is the next stage in my funnel?

    stage 3 is /shop/checkout
    stage4 is /shop/checkout/payment-details

    Can you advise on this?

    James Winfield

    19th October 2009 @ 16:44

  • 13

    Hey James,

    The only thing I can think of right now is that perhaps people are going to /shop/checkout/payment-details/ instead of /shop/checkout/payment-detail and GA is treating them as separate pages. But really that is clutching at straws.

    It’s hard to tell when you don’t know the URL, what is the website?

    David Whitehouse | http://www.david-whitehouse.org/

    20th October 2009 @ 13:23

  • 14

    Hi,
    I have goal on subdomain, and all visitors came thru main domain. Unfortunetly when they complite goal referer is from main domain. How to track true referer, which visitors come to my site?

    verSuS | http://www.pozycjonowanieioptymalizacja.pl

    26th October 2009 @ 11:09

  • 15

    Mate, thanks for the info it was really helpful. But could you please make the screenshots smaller? :p (It’s hard to read as it is at the moment)

    Moot | http://www.thinkerati.com/whiterabbit/

    27th October 2009 @ 20:31

  • 16

    Hello,

    We have an AdWords and Analytics account setup. Both of these accounts are successfully linked together. However, we are having problems utilizing the “Goals” feature in Analytics.

    After a user clicks on our ad within Google, they are taken to our main site. (www.mobilestorm.com). We would like to be able to track when they reach our sign up page (http://app.mobilestorm.com/signup/step1) after navigating our website. How do we setup the goals when it says that it should not contain a sub-domain?

    Is there anyway to do this if our Goal URL is a sub-domain of our main URL?

    Please let me know.

    Thanks!

    Derek

    7th December 2009 @ 18:59

  • 17

    Yes there is, you need to set it up so you can track across sub domains first though. Then when you setup the goals and the funnel you must include the entire address – to show which sub domain.

    David Whitehouse | http://www.david-whitehouse.org/

    9th December 2009 @ 09:02

  • 18

    number of visitors to my page are constantly changing sometime i get about 100 and sometimes only 10 visitors.

    noname | http://www.freebackgroundcheckrecords.com

    29th January 2010 @ 16:07

  • 19

    Brilliant guide, thanks for the help. Hopefully my Goal Funnels should work by changing it to the regex values…

    Shane | http://www.shanedj.com

    9th February 2010 @ 11:46

Write a Comment

*

*

*

Hear me speak at SES London 2010 Subscribe
to the David Naylor feed
Follow
David Naylor's Twitter feed

View Dave's Blog