Google analytics experiments sub-domain tracking - google-analytics

Is there something special about tracking a google analytics experiment across subdomains?
I have an experiment set up in an account which tracks a top-level domain and several sub-domains. The experiment is implemented in javascript and the experiment Id and variation are set using
cxApi.setChosenVariation(chosenVariation, opt_experimentId)
which is placed above tracking code (included via google tag manager). When creating the experiment I gave two dummy urls as the page variations and chose the 'Insert code manually' option, (although I did not insert the code as advised at https://developers.google.com/analytics/solutions/experiments-client-side :"The Experiment ID is the only information needed to continue and implement the experiment. The JavaScript snippet is not used.").
The experiment tracking is working for the top-level-domain, but not any of the subdomains. This seems strange because the account in which this is set up records all other tracking data successfully for all sub-domains. Does anyone have any idea what I might need to do to get the experiment tracking working in the sub-domains as well?
Thanks

Related

GA Cross Domain Tracking for subfolders with different UA-ID

Our site is broken down into 4 main subfolders lets say www.site.com/a/, www.site.com/b/, www.site.com/c/ and www.site.com/d/.
Each of those subfolders has a different Google Analytics tracking account because we treat those subfolders as different divisions.
We want to be able to track clicks from www.site.com/a/mypage.html to www.site.com/b/yourpage.html.
Because they have different tracking codes the clicks between divisions don't carry over between GA accounts. So when the page www.site.com/b/yourpage.html has stats the referrer is {not set} and the previous page path is set to {entrance}, even though they should be www.site.com/a/mypage.html.
It was suggested, during the creation of our GA accounts to put our domain site.com in the Referral Exclusion List to avoid new sessions being created but I'm wondering if this is what is causing the clicks to not detect the previous page or referrer page, because we are excluding it.
Can anyone help me figure out how I am going to track these stats?
Is using cross domain tracking an option, even though we're not changing domains?
Any help on this will be a big help. TIA
The exclusion from the referral is certainly what makes the direct traffic result, however it is correct that it is set like this. The main problem is that track the same site by dividing the sections into 4 different Analytics Properties is not a good practice.
Cross-domain tracking will not work because they are different Properties (unless you have GA360).
However you can get what you need by using the UTMs parameters on the links, for example for a link from site A to site B you will have to write the URL of the link like this:
www.site.com/b/yourpage.html?utm_source=fromA&utm_medium=referral
In reports you will see these values ​​in referral channel with the defined source instead of direct traffic.

View Google Analytics Data of Multiple Sites?

On the Google Analytics account I use, we collect analytics for multiple websites. We can see users and sessions for each website, that's great.
So far, every feature of Analytics I've come across only allows me to view information from just one site at a time, but now I'd like to see multiple sites.
What we are looking for, is a way to simultaneously view the number of users and sessions of all the websites under our account. I have google searched the problem, I've messed with every single setting I can think of. No progress.
How can we do this?
You could use Data Studio for this. You can either have separate tables on one page for all of the sites you want to report, or to make it more seamless, make a data blend to get stats from multiple sites with multiple GA accounts into one table
It is impossible to create a single view for different trackers in GA.
But you can download data from different trackers to one scheduled report in Google Spreadsheets using Google Analytics Spreadsheet Add-on https://developers.google.com/analytics/solutions/google-analytics-spreadsheet-add-on
Or create one new tracker and implement on all your websites.
You need to set up cross-domain measurement.
Cross-domain measurement makes it possible for Analytics to see sessions on two related sites as a single session. This is sometimes called site linking.
https://support.google.com/analytics/answer/1034342?hl=en

I'm unable to run experiments accross subdomains using Universal Analytics

I'm currently running an experiment without redirect, using Google Analytics, but I'm running in some issues.
The case
I work for a company that has two websites, with two separate brands, selling the same product. Today, we are plaining a merge of the brands, one of the reasons being the low costs of maintanance.
To see how this would affect sales, we are doing an a/b test. The test consists of changing the logo of the sites, and displaying an information about the merge of brands in the variant. The original is the website without changes.
We have some requirements to do it:
We use a CMS that has no support to the Google Analytics Experiment tag (we get some errors when we install it to the , and are unable to run it)
We need to run it through all pages of our websites. We have also a subdomain in each site, that the user is redirected to place an order.
We doesn't have time to wait for the experiment to end for itself. So, we came up with the idea to track the rejection and sales using a duplicate pageview with "/variant" in the url and in the title.
To do that, I used the Content Experiments without redirects, with the Google Tag Manager.
Configuration of the Experiment
In Google Tag Manager, I load the Content Experiment Javascript API and define the choosenVariation variable in all pages of both websites and subdirectories.
I track the "gtm.load" event, to see when the page finished loading all elements and change the DOM in three ways: changing the logo, adding the content about the merge and add an item to the main menu. All of this, through Javascript.
Along with the changes of the DOM, I add a datalayer called VirtualPageView, and pass the corresponding url with "/variant" and the title with "Variant".
When the datalayer fires, I send a new Pageview with the variant information.
The problem
The experiment is running right, but when a user gets the B variant of the experiment and procceed to a subdomain of our websites to place an order, it seems that it's somehow running another test, and happens to the user get the A variation.
We are trying to persist the original session and the client Id through the domain and subdomain, in order to the user that saw the different logo, continue in his way to order.
I saw this page about Running Experiments across Subdomains, but its about the Classic Analytics and the classic experiment, and we are using the Universal Analytics with the Content Experiment without redirects.
I don't know if my explanation was clear enough, so if someone have doubts, please ask me. I don't have a profound knowledge of Google Analytics or the Content Experiments either. So, if you have a better way to do this, please, tell me.
I came up with a solution to our problem. We agreed to use the experiment only in the pages of the main domain, so I can change the content otherwise in the pages of the subdomain:
When a user visits our main domain, through Google Tag Manager, I created a cookie that says what the result of the variation chosen for the user (0 for the original and 1 for the variation).
When this user goes to our subdomain to place an order, still via GTM I check the cookie to see its value. If its equal to 1 (a variation), I change the logo and the menu, according to our previous configuration, and I send a virtual pageview to help us check the data.
Until now, this is working properly.

Targeting Sources With Google Analytics Experiments

I am curious if Google Analytics Content Experiments supports targeting based on the traffic source, in particular, certain Google Adwords campaigns.
For example, I have two Adwords campaigns pointed to the same destination url but would like a Content Experiment to only run for one of these two campaigns.
Even targeting the experiment based on the referring url would be helpful but I don't see an option to do so when setting up the experiment. Does anyone know if this is possible through the set up, or if I would need to create some kind of gateway that my campaigns funnel through and then get routed to the experiment URL based on the source?
Thanks!
Google does not currently provide this function by default.
I'd try https://www.optimizely.com/ (easier) and/or patching up custom bucketing code (more difficult)

Why does Google Analytics cross-domain tracking across an iframe require tracking snippets in both domains?

I'm creating a shareable widget, for anyone to copy onto their website. The shareable piece of code is an frame that points to the actual widget that lives on our hosted site (i.e. ourdomain.com). If we ever want to tweak the actual widget, we can do so in one place, with no effect on the iframes pointing to it from other sites we have no control over.
I tried the approach of cross domain tracking. While I was analyzing the results, I observed that the path of the shared widget code (not on our domain) appears within the content view in GA. This runs counter to a response from my previous post "if it is being inserted into many domains you are going to need to set up multiple GA accounts and use different account numbers per user."
Correct me if I am wrong: Any tracking code using our unique account id will appear in our GA by default, no matter where it's hosted, whether the code is implementing cross domain tracking or not.
http://www.google.com/support/forum/p/Google+Analytics/thread?tid=6af5b4c3e30c71be&hl=en
Since any page that hosts GA tracking code shows up in our content view, I could locate where the widget is being viewed by simply looking for all pages whose name did not include ourdomain.com. Of course this includes proxy servers as well, but I was going to also include a custom variable so I could implement a filter based on the custom variable.
So explain to me where this breaks down or what I'm missing here. Is there some amount of data I am losing here because the GA cookie is not in fact being utilized? Give me a good reason why I should put in the effort to fully implement cross domain tracking, including the necessary P3P implementation on our server for IE visitors.
As a sidenote, I am considering adding GA tracking code with an event tracker within the widget itself to track when people actually USE the widget (as distinct from the when the widget is loaded). I understand that by not implementing cross domain tracking I would not be able to obtain any data about the visitor, only whether the widget was acted upon or not.
As the referring site is the primary bit of information we need,
I'm going to pass the referrer in the URL that loads the iframe content
and then overide the referrer within the tracking code
_gaq.push(['_setReferrerOverride',ht_referrer]);
as documented here:
http://www.prusak.com/google-analytics-referrer-override/
This way, I don't need to inject tracking code into my widget, just some JavaScript that adds the referrer to the URL that loads the iframe.
Wish me luck.

Resources