Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

We currently have Analytics tracking codes running throughout our site including our Sub Domains.

What I would like to do is create different Profiles under the same account segmenting the sub domains by means of filters.

Currently I am just excluding the hostname of the main website by using the following custom filter:

Exclude: Hostname Filter pattern: ^www.mydomain.co.za(.*)

I know this isn't the proper method of doing this though and have some of the main domains links coming through in the data.

Ideally I would just like to include anything from: sub.domain.co.za

Any help would be greatly appreciated.

share|improve this question

migrated from superuser.com Jan 24 '11 at 12:59

This question came from our site for computer enthusiasts and power users.

    
Could you clarify? Do you want to be able to do a report of all data and one report per sub domain? –  RandomBen Jan 24 '11 at 13:31
add comment

2 Answers 2

Using _setDomainName overwrites the hostname - which means that you can no longer distinguish which subdomain the visit came to.

More specifically sub.mydomain.co.za/index.html and www.mydomain.co.za/index.html would both be tracked as a visit to www.mydomain.co.za/index.html

Perhaps I mis-understand the question, but it sound like what you are wanting is straight-forward - a separate profile filtering traffic for each sub-domain.

Try this:

Custom Filter Include: Hostname Filter pattern: sub\.domain\.co\.za

share|improve this answer
    
"_setDomainName overwrites the hostname" where is this documented? I've seen solutions to this problem similar to the other answer, which also use a hostname filter, but that would not work if this statement is correct. –  roryf Oct 19 '12 at 10:38
add comment

Try this: http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html#multipleDomains

Where you would modify

_gaq.push(['_setDomainName', '.example-petstore.com']);

to

_gaq.push(['_setDomainName', '.mydomain.co.za']);

The profile for each subsite could us a custom filter on hostname to show only traffic to the subsite.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.