Page 1 of 1
How do I have script run after google analatyics e-commerce
Posted: Tue Apr 07, 2009 2:03 pm
by gary-trainsignal
I'm troubleshooting Google Website Optimizer right now on our site. It tracks great, however when we run a GWO test the e-commerce tracking from our analytics stops collection $ data. Analtyics keeps collecting data, but the e-commerce tracking stops. I've brought in a Google consulting firm and they've informed me that the GWO code needs to be execute on the page after the pageTracker ecommerce code:
Code: Select all
<script language="JavaScript">
<!--
pageTracker._addTrans("33147","","113.70","9.70","7.00","Inverness","IL","US");
pageTracker._addItem("33147","05-046-C","Access 2007 Training","Microsoft Office 2007 Training","97.00","1");
pageTracker._trackTrans();
// -->
</script>
In Able when you check the enable ecommerce tracking that code is run as the second to last thing on the page after the Footer (which includes the google analytics and where i've been putting the GWO code) and the WebParts Code. Is there anywhere I can place code so it runs below the ecommerce code? Does anyone know what file even has the e-commerce code in it? I was looking through the Google Widget and Receipt.ascx file and didn't see anything at first glance.
Any help is welcome. Thanks
-Gary
Re: How do I have script run after google analatyics e-commerce
Posted: Tue Apr 07, 2009 3:03 pm
by jmestep
A site where I know it is working is using what came with Able. The code is in the ConLib/GoogleAnalyticsWidget.ascx.cs around line 108. GA shows ecommerce results for this site.
Re: How do I have script run after google analatyics e-commerce
Posted: Tue Apr 07, 2009 3:12 pm
by gary-trainsignal
hmm.. doesn't bode well for me
Thanks, I just came across that code as well. That is the code behind that creates the string to be displayed and now the attempt is to locate where in the code the RegisterTransactionScript() function is called from so that code actually displays.
I'm in the midst of downloading the entire site's code and indexing it so I can search for that exact call. Fingers crossed.
Open for other ideas as well.
Thanks.
Re: How do I have script run after google analatyics e-commerce
Posted: Wed Apr 08, 2009 6:27 am
by jmestep
It is called up above in the Page_Init. (This is from Able 7.0.2)
Code: Select all
protected void Page_Init(object sender, EventArgs e)
{
_Settings = Token.Instance.Store.Settings;
if (_Settings.EnableGoogleAnalyticsPageTracking && (_Settings.GoogleUrchinId.Length > 0))
{
trackingPanel.Visible = true;
if (_Settings.EnableGoogleAnalyticsEcommerceTracking)
{
if (this.IsReceiptPage)
{
_OrderId = AlwaysConvert.ToInt(Request.QueryString["OrderId"]);
_Order = OrderDataSource.Load(_OrderId);
if (_Order != null && _Order.Items.Count > 0)
{
RegisterTransactionScript();
}
else UnRegisterTransactionScript();
}
else UnRegisterTransactionScript();
}
else UnRegisterTransactionScript();
}
else
{
trackingPanel.Visible = false;
}
}
Re: How do I have script run after google analatyics e-commerce
Posted: Wed Apr 08, 2009 10:22 am
by gary-trainsignal
Thanks Judy.
By any chance do you know if the cart that has it working is split testing or multivariate testing? I haven't tried to see if it works with split testing. We've only been running mulit tests.
Re: How do I have script run after google analatyics e-commerce
Posted: Wed Apr 08, 2009 11:28 am
by gary-trainsignal
Also, do you know where the working client is calling the Google Website Optimizer code from on their confirmation page?
Thanks again
Re: How do I have script run after google analatyics e-commerce
Posted: Wed Apr 08, 2009 12:41 pm
by jmestep
There aren't any goals set, there is no multi-variate testing, just normal tracking and ecommerce. No website optimizer code. (It's my son-in-law's site so I set it up.)
Re: How do I have script run after google analatyics e-commerce
Posted: Thu Apr 09, 2009 9:58 pm
by gary-trainsignal
I gotcha. Yeah, no problem at all for analytics and ecommerce tracking when thats all we've got running. It's the dang GWO code that throws a wrench in our tracking.
