Initially I started with a single domain. Installed the GA module in Drupal, got my account setup with Google, and all was working as it should in regards to GA.

I then split my site into sub domains.

mydomain.com - now just for launching to the sub domains
1.mydomain.com
2.mydomain.com
3.mydomain.com

Am having problems setting up yhr tracking my sub domains with GA.

I currently have 4 separate sites/Drupal installations/databases.
Each installation has the GA module installed with the same UA number as mydomain.com.

Per another issue that I was looking at I've plugged a snippet into the GA module in mydomain.com that is supposed to allow the sub domains to be tracked.

This is what I've plugged into custom javascript area of mydomain.com:
pageTracker._setDomainName("mydomain.com.com");

Is this correct and if so what about my sub domains. Should I have the GA module running in those and if so should I use the same UA number that I do in mydomain.com.

I've goofed with different profiles in my account on the Google Analytics page. For example if your create profiles it assigns different dash (i,e., -2, -3, -4) numbers to the same UA number. Plugged these new dash numbers into the GA modules for each subdomain.

I've also tried setting up multiple accounts for each sub domain with unique UA numbers. Plugged these unique new UA numbers into the GA modules for each sub domain.

None of this seems to work.

Any help anyone could offer would be appreciated.

Comments

hass’s picture

Status: Active » Fixed

As i know, all domains need the custom code.

pageTracker._setDomainName("mydomain.com");

This make sure that the google cookie is set for this domain and is than shared across all sites. Take a look to the google docs...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Carlos Miranda Levy’s picture

Version: 6.x-2.2 » 6.x-3.0

Do we still need to insert the following at "Code snippet (before):"?

  _gaq.push(["_setDomainName", ".mydomainname.com"]);

My guess is that we still do, since there is no other place to define the DomainName.

However, the new google code uses single quotes, as in:

  _gaq.push(['_setDomainName', '.mydomainname.com']);

Does it matter at all?
Should I upgrade my code to single quotes?

Carlos Miranda Levy’s picture

Status: Closed (fixed) » Active

Since this is about 3.0, I am switching it to active.

hass’s picture

Status: Active » Closed (fixed)

Single quotes or double quotes doesn't matter. Use the double quotes to make it consistent and you are done.

Aside - have you run the upgrade hook? It should have upgraded your custom before snipped automatically!? Does ist work or not? Would be great to get some feedback here...

luksak’s picture

Status: Closed (fixed) » Active

hi

i have a single installation of drupal used to also cover subdomains. how can i set up GA to track those seperately?

i found this: #547390: Domain Access & Separate Google Analytics Accounts

but this does notcove tracking subdomains: http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html#...

any ideas?

thanks

hass’s picture

Status: Active » Closed (fixed)

Never reopen old cases, please.

Do nothing special and only use unique web property id's and You are done