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
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)

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:

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.
19 Comments
-
- 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.
- 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.
- 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.htmlthen 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.htmlthanks.
- 9
Thanks for explaining “funnel” the easy and more comprehensive way. But is the actual task of doing it as easy as your explanation?
- 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?
- 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
- 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-detailsCan you advise on this?
- 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? - 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)
- 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!
- 18
number of visitors to my page are constantly changing sometime i get about 100 and sometimes only 10 visitors.
- 19
Brilliant guide, thanks for the help. Hopefully my Goal Funnels should work by changing it to the regex values…



Thank you! I so needed this!