Hello. I'm a newbie so please bear with me. I'm using domain access module 6.x-2.11 for a site wherein the main domain points users to multiple subdomains (domain.com, sub1.domain.com, sub2.domain.com, etc.). I have configured the google analytics module as attached for 'all domains'.

In my google analytics account, I have tried adding filters for the main domain as well as the subdomains but no data is collected.

I then abandoned the use of filters and tried using advanced segments instead. In each segment, I find an exact match for domain 'sub1.domain.com' or 'sub2.domain.com', etc. but no visits are ever found.

I've been searching and trying different things for an entire day to no avail.

The fix must be very simple, I just can't figure it out.

Can someone please help?

Thank you.

CommentFileSizeAuthor
google_analytics_settings.jpg1.71 MBnewbie999
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Project: Google Analytics » Domain
Version: 6.x-3.2 » 6.x-2.x-dev
agentrickard’s picture

I don't even understand the question.

You probably want the module in http://drupal.org/node/547390#comment-2942284

hass’s picture

Status: Active » Fixed
agentrickard’s picture

The module linked to above gives you a UI for that.

agentrickard’s picture

Status: Fixed » Closed (duplicate)
newbie999’s picture

Hello. I apologize if I wasn't clear. Maybe I posted this to the wrong project. Should I post this to the google analytics project instead?

The issue I'm having is that I'm using domain access and have decided to use 1 google analytics account to track analytics data for all my domains (primary domain and subdomains). However, when I pull up my analytics report from google, I'm unable to see data for any of my subdomains. When I use advanced segments to segment the data by subdomain, no data is found for any of my subdomains.

Would you be able to direct me to where I may be able to find help? Thank you.

newbie999’s picture

Status: Closed (duplicate) » Active

Hello. I apologize if I wasn't clear. Maybe I posted this to the wrong project. Should I post this to the google analytics project instead?

The issue I'm having is that I'm using domain access and have decided to use 1 google analytics account to track analytics data for all my domains (primary domain and subdomains). However, when I pull up my analytics report from google, I'm unable to see data for any of my subdomains. When I use advanced segments to segment the data by subdomain, no data is found for any of my subdomains.

Would you be able to direct me to where I may be able to find help? Thank you.

agentrickard’s picture

I cannot. That sounds like a Google question to me.

Are the pages all getting instrumented properly? (e.g. is the GA code on all the pages as expected).

newbie999’s picture

Yes, I checked a random number of pages and they have the snippet below right before the /body tag.

Also, there's quite a bit of content that is common between the primary domain and the subdomains. However, even for the content that is specific to each subdomain, I get no data even though there is traffic to those pages.

Thanks for your help.

newbie999’s picture

<script type="text/javascript">
<!--//--><![CDATA[//><!--
var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-xxxxxxxx-1"]);_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);})();
//--><!]]>
</script>
onaz’s picture

This definitely seems like a problem outside of the scope of Domain Access.

I have a similar setup with no issues whatsoever. I have a Domain Access site with ~8000 domains and one tracking code to rule them all. Stuff you need to have in order for it to work:

All should be ok with those settings. If in doubt, use Firebug's network analysis tool to verify that Google is really contacted on each request.

hass’s picture

#10 shows ga module is not configured for domains with subdomains tracking. Above code shows the config is plain default and is configured for single domains/site and this is incorrect! It's the second radio box that need to be selected... Ga module admin page is very clear about this. There is no need for anything else - ga supports all this stuff. Nothing required from domain access.

agentrickard’s picture

Project: Domain » Google Analytics

Moving.

hass’s picture

Status: Active » Fixed
newbie999’s picture

I was finally able to get it working. What I was missing was this piece of code in the 'custom javascript code' section of the google analytics module configuration (code snippet before):
_gaq.push(['_setDomainName', '.mydomain.com']);

Once the code was in place, I also needed to add a filter to my google analytics profile per #11 to show the full domain in the reports (domain.com, sub1.domain.com, sub2.domain.com, etc.).

For those experiencing the same problem I did, this documentation on cross-domain tracking proved extremely helpful - http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html

hass’s picture

NO!!! This code will be added AUTOMATICALLY if you setup the correct radio box in the first field set! If you don't see this radios you are blind or not using the latest release. Remove the code snippet from custom code snippet settings or you are asking for future troubles.

Status: Fixed » Closed (fixed)

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

Erik Seifert’s picture

Issue summary: View changes

Expose to domain_variables

Create a custom modue (website_custom)

function website_custom_variable_info_alter(&$variables, $options) {
	$list = array(
			'googleanalytics_account',
	);
	foreach ($list as $name) {
		if (isset($variables[$name])) {
			$variables[$name]['multidomain'] = TRUE;
		}
	}
}
hass’s picture

Already inside the module.