I'm unable to run experiments accross subdomains using Universal Analytics - google-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.

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.

Google analytics showing hundreds of views for page that doesn't exist

I recently signed up for a google analytics account in anticipation of a new site I'm putting together. The site has not been published, and the tracking script has not been put in the code yet.
Somehow after logging back in to grab the tracking code, it's showing I've already had 275 views in the past month. How is this possible???
These are very likely ghost referrals sent by spammers targeting random GA property IDs (which explains why you see them even before your Web site is live). Since you are setting up a new site, probably the easiest way to get rid of them is to create a new Web property so that you get an ID not ending with -1. The reason is that this type of spam is only targeted at the first property in an account.
If you want to get more information about how referrer spam works and alternative solutions to eliminate it, here is an article I wrote some time ago:
http://veithen.github.io/2015/01/21/referrer-spam.html

Google analytics experiments sub-domain tracking

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

Tracking displays of iframe component in Google Analytics

Site A gives their affiliates an interactive component (traffic map based on Google Maps), which they in turn put on their sites (Site B) in an iframe. The component is dynamic, doesn't change the URL of parent site, and has an id for each affiliate site.
What I would like to do is track the displays of the component. (Price of using Google Maps for the component depends on number of views).
At the moment the component is in <iframe src="http://SiteA.com/q?cp=43.520,18.910,10&cm=1"></iframe>.
I have looked at the other topics but didn't found a solution to that problem. I would really appreciate any help, I had no experience with cross-site tracking yet.
You as siteA owner want to count number of displays of iframe on other sites, correct?
The basic way to do it is logs analysis β€” every time your server returns page http://SiteA.com/q?cp=43.520,18.910,10&cm=1 or similar it adds an entry to your server's log files. The can be count when. There is a number of solutions for analyzing log data. Some of them opensource and free, other are paid services. For exmaple: http://awstats.sourceforge.net/
There is other ways to count it, but it's probably easiest way of all.

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