AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
2K members online now
2K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Experiments Cause Adding my Web-site's Domain into Referral Traffic report

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I set up the experiment with relative links to test different styles of the page. The server would serve different style-sheets depending on the url, using the $_GET method.

Original page to test: mydomain.com/property/house1

Variation 1: ?ab=1

Variation 2: ?ab=2

 

Right after the <body> tag I have a code to initialize the exepriment and then Google analytics:

 <!-- Google Analytics Content Experiment code -->
        <script>function utmx_section(){}function utmx(){}(function(){var
        k='XXXXXXXXX-1',d=document,l=d.location,c=d.cookie;
        if(l.search.indexOf('utm_expid='+k)>0)return;
        function f(n){if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.
        indexOf(';',i);return escape(c.substring(i+n.length+1,j<0?c.
        length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write(
        '<sc'+'ript src="'+'http'+(l.protocol=='https:'?'s://ssl':
        '://www')+'.google-analytics.com/ga_exp.js?'+'utmxkey='+k+
        '&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='+new Date().
        valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
        '" type="text/javascript" charset="utf-8"><\/sc'+'ript>')})();
        </script>
        <script>utmx('url','A/B');</script>
<!-- End of Google Analytics Content Experiment code -->

<!-- Google Analytics Tracking --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'XXXXXXX', 'auto'); ga('require', 'linkid'); ga('send', 'pageview'); </script>

When I land on the experiment page it correctly adds a respective experiment variation by adding ?ab=[NUMBER] and utm_expid=XXXXXXXX to the URL.

Once I leave the experiment page and browse the web-site and return back to the experiment page it adds utm_referrer=mydomain.com to the link.

 

I guess this causes adding my web-site statistics to the Referral Traffic. And this is being implemented by the script, which is a part of the standard Google Experiment code

<script>utmx('url','A/B');</script>

 

How do I remove my own web-site from shoeing in the referral traffic report?

1 Expert replyverified_user

Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Rising Star
# 2
Rising Star
Hi Qualistay G,

The short answer is utm_referrer is expected and it's purpose is to help GA keep the attribution correct which was a big issue with GWO.

https://support.google.com/analytics/answer/2521682?hl=en

If you are seeing self referrals before the experiment (some are always expected) you should ensure that you have the same version of the tracking code on each and every page of the site. You should not see a marked increase after the experiment is deployed.

Hope that helps.

Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi, Theo!
Thanks for your reply! I do have the same tracking code on each page, but I have experiment code only on pages I am trying to test. Should I add this experiment code to each page now? Otherwise, when I did not have any experiments running, there were no self-referrals.

Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Rising Star
# 4
Rising Star
No! You only need the Experiment control script on you "A" page - It should not be on any other pages.
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
I have a dynamic page, so I serve this code only on pages that come after http://mydomain.com/property/, e.g. mydomain.com/property/house1; mydomain.com/property/house2
Should I exclude pages, which have variations (e.g. mydomain.com/property/house1?ab=1, mydomain.com/property/house2?ab=2, etc.), from having the experiment code?

Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Rising Star
# 6
Rising Star
Hey Qualistay,

The only page that should have the control script is the page you are testing, the variations and all other pages should only have the standard Google Analytics Tracking script.

Does that make sense?

Best,

Theo
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

t Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

[ Edited ]
Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Yes, if I were testing a single page. But I am testing a Group of product pages, which share the same template. Google does not prohibit us from doing this. I referred myself to this article: https://support.google.com/analytics/answer/2664470?hl=en&ref_topic=1745208 (a part called: How Relative URLs Work with Multiple Original Pages). If I were testing only a page with a specific single product, then when a user goes to look at another product he would be seeing a different design during the same session. So I am trying to have consistency in design throughout the pages.
However, the documentation does not describe the implementation of this method. And now I am getting self-refferals....

 

Maybe I should make the Google Tracking Code synchronous to load After the experiment? Now the setting is 

a.async=1; 

 

Re: t Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Rising Star
# 8
Rising Star
Hi Qualistay,

Right the page or pages that your are testing. My point is that the variations typically should not have the control script. That said, I haven't seen this cause self referrals. Are you sure that you're getting attribution overwritten as self referrals? utm_referrer= is expected.

You may want to test with utm params like these: ?utm_source=test&utm_medium=test&utm_campaign=test and go through the process and see how the visit is attributed.

Best,

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: t Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭
Testing with utm params is showing as (Other) in the default channel grouping (Treemaps report). I removed the experiment code from the variation pages. I don't know what else could be the casue. GA code is on every page after the experiment. I don't use any cross-domaining. Let's see how it goes...

Re: t Re: Experiments Cause Adding my Web-site's Domain into Referral Traffic report

Rising Star
# 10
Rising Star
If you used the params I gave you it should fall under other.

Please look at source/medium report instead.

-Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn