Question

I have a website that is hosted with Weebly.com and an unable to get it set up for split testing with google analytics. There are 3 attachments:

 Shown in the attachment is my error notice.
 The second email shows how I input HTML into Weebly.
 The 3rd image is an email from Weebly telling me that this can be done but it is challenging. 
4th image is the Weebly editor where I can make html changes

If anyone can direct me to how to get this working I will be very grateful !

enter image description here enter image description here enter image description here enter image description here

Was it helpful?

Solution

I'd strongly suggest switching over to using a prefix on your GA code. Ideally Weebly should be using this prefix since they are the vendor, but in this case they are not.

As it stands now, you have the following happening:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28626443-1']);
_gaq.push(['_trackPageview']);

Then later on the page, Weebly's GA code gets inserted on the page..

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-7870337-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

You can see that this will overwrite your tracker and changes the domain name (from auto to none). I'd suggest replacing your code with something like the following:

var _gaq = _gaq || [];
_gaq.push(['my._setAccount', 'UA-28626443-1']);
_gaq.push(['my._trackPageview']);

OTHER TIPS

Two other changes in addition to this that are (probably) necessary b/c Weebly inserts its own GA tracker on your pages.

[1] In your analytics tracker code, you need to add a custom domain (in this case, along with the prefix). So right after your

_gaq.push(['my._setAccount', 'UA-12345678-0']); 

add the following: _gaq.push(['my._setDomainName', 'your-domain-name-whatever-it-is']);

So now your GA tracker code should start with something like the following: var _gaq = _gaq || []; _gaq.push(['my._setAccount', 'UA-12345678-0']); _gaq.push(['my._setDomainName', 'your-domain-name-whatever-it-is']); _gaq.push(['my._trackPageview']);

NOTE: that _setDomainName is what Google would tell you to do by default had you told Google that you were actually tracking a subdomain. In this case, your Weebly site is (most likely) a subdomain of weebly.com e.g. my-domain-name.weebly.com

[2] In your Content Experiments (CE) code, you have to tell Google to use this "other" domain. Otherwise, it uses the default domain (which seems to be Weebly's domain).

To do this, look at your CE code. It probably begins something like this: function utmx_section(){}function utmx(){}(function(){var k='12345678-0',d=document,l=d.location,c=d.cookie; if(l.search.indexOf('utm_expid='+k)>0)return; blah-blah-blah

Insert the following line immediately after the comment and before the function: _udn = "your-domain-name-whatever-it-is"

So now your CE code looks like this:

<!-- Google Analytics Content Experiment code -->
<script>_udn = "your-domain-name-whatever-it-is"</script>
<script>function utmx_section(){}function utmx(){}(function(){var
k='12345678-0',d=document,l=d.location,c=d.cookie;
if(l.search.indexOf('utm_expid='+k)>0)return;
blah-blah-blah

Last important point. The CE code appears ONLY on the "primary" or "A" version of your AB test page. Put this code in the "Header" of the page by going to Weebly's "Advanced Settings" for the "A" version of your AB test page.

However, the CE code must appear before your analytics tracker code Weebly's tracker code is (helpfully, for this purpose) in the footer of every page. So Weebly's tracker code will not interfere with your AB Test code. However, if you use Site Settings to put your analytics tracker code onto every page of your Weebly site, then you probably want to use the Site Settings FOOTER (capitalized for emphasis) and not the header. Weebly appears to put Site Settings headers above (in front of) page specific headers. Content Experiments will choke on this. If you really want your Analytics tracker code in the header of every page (and there are some reasons for this having to do with counting bounces etc.) then you probably will need to manually paste your tracker code onto every page header using Advanced Settings. When you get to the "A" version of your AB test page, simply remember to paste your tracker code AFTER your CE code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top