Not able to track traffic on subdomain using Google Analytics
Posted
by
Steven
on Pro Webmasters
See other posts from Pro Webmasters
or by Steven
Published on 2012-03-12T12:54:01Z
Indexed on
2012/04/12
11:44 UTC
Read the original article
Hit count: 247
google-analytics
|subdomain
I'm trying to track traffic for my sub-domain, but it's not happening.
This is how it's set up.
My partner has a domain called sub1.partner.com. This domain points to partner1.mydomain.com. The idea is that users think they are browsing my partners website, when they are in fact browsing pages on my server.
My tracking code looks like this:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
_gaq.push(['_setDomainName', '.mysite.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
In Google analytics I've created a new account under my main account and called in partner1.mysite.com.
On this account I have created a filter:
Filter type: include
Filter field: Host name
Filter pattern: partner1.mysite.no
Case sensetive: No
What more can I try to track traffic on my subdomain?
UPDATE
Question 1
Is this line correct?
_gaq.push(['_setDomainName', '.mysite.com']);
Question 2
Is it correct that I have to add \
before any punctuations like so \.
in filters?
© Pro Webmasters or respective owner