Welcome to the Official AdWords Community

Reply

Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

| ‎27-02-2012 10:40 AM
0

We recently changed our Analytics code to track e-commerce data. We would also like to run Website Optimizer (WO) on these same web pages. In the past, this has worked fine. Since adding e-commerce, new WO experiments collect no data and running WO messes up our e-commerce data.

 

Two references in Google state that if Analytics code has been changed, then "you must make the same modifications to your WO code" http://support.google.com/adwords/certification/bin/answer.py?hl=en&answer=152557 and http://support.google.com/adwords/certification/bin/static.py?hl=en&page=guide.cs&guide=23825&topic=...

 

However, neither reference above details how exactly to modify the WO code, nor are any example given. Does anyone know of a good reference for making these changes to the WO code?

 

Les

Message 1 of 16 (708 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Reply to lesandmich
| ‎27-02-2012 12:24 PM
0

Hi lesandmich, petebardo (a fellow TC) is an absolute whizz on conversion codes... I'll give him a nudge...

 

Jon

Message 2 of 16 (703 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Reply to Cobnut
| ‎27-02-2012 12:34 PM

Thanks Jon!

Message 3 of 16 (700 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Reply to lesandmich
| ‎27-02-2012 12:45 PM
0

Hi lesandmich,

 

As much as I appreciate Jon accolades, I really don't know much about the WO code. The best I could do is take a look at the code on your pages and see shat I can find. I'm pretty good a debugging other people's code.

 

So, first a couple questions.

 

What did you change in the GA script after installing the WO code?

 

URL's for both test page and conversion page?

 

I'll see what I can do.

 

Pete

 

petebardo -- Deadhead doing AdWords
Message 4 of 16 (697 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Reply to petebardo
| ‎27-02-2012 01:49 PM
0

Hi Pete,

 

The GA code on all our conversion pages was changed from the standard code to the code below (Asynchronous Google Analytics eCommerce Code) to begin tracking static e-commerse data. Also shown below is the standard WA code on this particular conversion page (all in <head>). The modified GA code is only on our conversion pages - all other website pages still use the standard GA code.

 

The code shown below is working properly and we are still collecting WA data because the WA code was there before the new GA code. The problem occured when we tried to run a new WA test using a conversion page that already had the new GA code on it.

 

Standard WA and New GA (e-commerce) codes (account number has been X'ed out):

 

<!-- Google Website Optimizer Tracking Script - 26Oct2011 split test -->
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['gwo._setAccount', 'UA-XXXXXXX-X']);
  _gaq.push(['gwo._trackPageview', '/0554376915/goal']);
  (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>
<!-- End of Google Website Optimizer Tracking Script - 26Oct2011 split test -->

<!-- Asynchronous Google Analytics eCommerce Code -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'1',                    // order ID - required
'Online Order Form',    // affiliation or store name
'57.00',                // total - required
'0.00',                 // tax
'0.00',                 // shipping
'',                     // city
'',                     // state or province
''                      // country
]);
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
_gaq.push(['_addItem',
'1',                                  // order ID - required
'UPGRADE',                     // SKU/code - required
'Book',  // product name
'Upsell',            // category or variation
'57.00',                                 // unit price - required
'1'                                      // quantity - required
]);
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(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>
<!-- End Google Analytics eCommerce Code -->
</head>

 

 

Thanks,

Les

Message 5 of 16 (691 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Community Manager Zee Community Manager
Reply to lesandmich
| ‎27-02-2012 04:44 PM
0

Hi lesandmich, 

 

You might want to try post your question on the Google Analytics forum. 

 

Thanks,

Zee

Zee
G+
Message 6 of 16 (684 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Reply to Zee
| ‎27-02-2012 05:40 PM
0

Thanks Zee, the post is up on the Analytics formum now.

Message 7 of 16 (680 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

[ Edited ]
Reply to lesandmich
| ‎29-02-2012 07:27 AM
0
Last edited 29-02-2012 07:27 AM by lesandmich

No luck on the Analytics Forum. Anyone else have any suggestions? The following fix seems to address a similar issue, though cross sub domain tracking and multivariate tests don't apply to us:

 

http://groups.google.com/a/googleproductforums.com/forum/#!topic/analytics/pkk1tUr5Bs4 and
http://support.google.com/websiteoptimizer/bin/answer.py?hl=en&answer=117912

Would the above fix our issues?

 

Thanks, Les

Message 8 of 16 (660 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Community Manager Zee Community Manager
Reply to lesandmich
| ‎29-02-2012 10:55 AM
0

Hi lesandmich

 

Hmm, let me see if I can find somebody to help you. 

 

Zee

Zee
G+
Message 9 of 16 (653 Views)
Please use plain text.
Full Reply Editor

Re: Modifying Website Optimizer code when Analaytics (e-commerce) code is also on page

Reply to Zee
| ‎01-03-2012 09:53 AM
0

Hi lesandmich,

 

For some reason I hadn't been getting email from this thread. I'll have to do a little digging on the right way to do this with the asynch code. I think there's a problem in that you are importing the ga.js twice. You shouldn't need to do that and it may be causing a problem.

 

I'll get back to you.

 

Pete

 

 

petebardo -- Deadhead doing AdWords
Message 10 of 16 (642 Views)
Please use plain text.
Full Reply Editor

Did this Answer Your Question? If not post your question here