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

I have a website at mydomain.com that uses Analytics.

I have a blog that resides at mydomain.com/blog/, which also uses Analytics

They are on different profiles. The main site uses something like:

_gaq.push(['_setAccount', 'UA-XXXXXXXX-6']);

While the blog uses:

_gaq.push(['_setAccount', 'UA-XXXXXXXX-7']);
_gaq.push(['_setCookiePath', '/blog/']);

My issues is that this seems not to track referrals from the blog through to the main site when, for instance, the logo which links to the main site is clicked.

Ideally, I would like the clicks of this logo to report that the source was mydomain.com/blog/, but because they are at the same domain they seem to register as direct traffic.

Have I missed a step in my configuration, or will I have to resort to linking to something like mydomain.com?ref=blog?

Thank you.

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

My understanding was that _setDomainName('none') was used to seperate subdomains not subdirectories. Did this work for anybody?

I've tried the original scenario mentioned above by doctororange and got the same results - traffic from blog showing as direct traffic.

I also tried using profiles on the same domain and applied filters. In this case traffic showed from it's origninal source before the blog.

Is there any way to seperate a subdirectory so it's treated like a differnt domain I guess is my question!

I'm beginning to think it may be better just to use one profile and perhaps advanced segments.

share|improve this answer
    
Hi Dave. I'm accepting this because I too ended up using a single profile and advanced segments. I couldn't find a way to make a subdirectory behave as a different domain. –  doctororange May 2 '12 at 12:01
add comment

Have you tried using the function "_setDomainName('none')". That way both URLs are treated as different, else you need to:

_gaq.push(['_setAccount','UA-XXXXXXXX-6']);
_gaq.push(['_setAllowLinker',true]);
_gaq.push(['_setDomainName','mydomain.com']);

and set the backlinks to:

<a href="http://mydomain.com/blog/" onclick="_gaq.push(['_link','mydomain.com/blog/']);return false;">Link to blog</a>

as well as set:

_gaq.push(['_setAccount','UA-XXXXXXXX-7']);
_gaq.push(['_setDomainName','none']);
_gaq.push(['_setAllowLinker',true]);

and set links back via:

<a href="http://mydomain.com/" onclick="_gaq.push(['_link','mydomain.com']);return false;">Back to site</a>
share|improve this answer
add comment

I would advise you use the same tracking code for mydomain.com and for it's subdirectores like /blog/ and set up profiles for the site in you GA account for this. With a filter like "include only traffic to subdirectories that contain /blog/".

Use different tracking codes for different domains or subdomains, and not for subdirectories.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.