How do I have script run after google analatyics e-commerce

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
gary-trainsignal
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Dec 08, 2008 1:10 pm
Location: Rolling Meadows, IL
Contact:

How do I have script run after google analatyics e-commerce

Post by gary-trainsignal » Tue Apr 07, 2009 2:03 pm

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
_________________
Gary Eimerman
Train Signal
Global Leader in Professional Computer Training
http://www.trainsignal.com
http://garyeimerman.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: How do I have script run after google analatyics e-commerce

Post by jmestep » Tue Apr 07, 2009 3:03 pm

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.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

gary-trainsignal
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Dec 08, 2008 1:10 pm
Location: Rolling Meadows, IL
Contact:

Re: How do I have script run after google analatyics e-commerce

Post by gary-trainsignal » Tue Apr 07, 2009 3:12 pm

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.
_________________
Gary Eimerman
Train Signal
Global Leader in Professional Computer Training
http://www.trainsignal.com
http://garyeimerman.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: How do I have script run after google analatyics e-commerce

Post by jmestep » Wed Apr 08, 2009 6:27 am

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;
        }
    }

Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

gary-trainsignal
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Dec 08, 2008 1:10 pm
Location: Rolling Meadows, IL
Contact:

Re: How do I have script run after google analatyics e-commerce

Post by gary-trainsignal » Wed Apr 08, 2009 10:22 am

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.
_________________
Gary Eimerman
Train Signal
Global Leader in Professional Computer Training
http://www.trainsignal.com
http://garyeimerman.com

gary-trainsignal
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Dec 08, 2008 1:10 pm
Location: Rolling Meadows, IL
Contact:

Re: How do I have script run after google analatyics e-commerce

Post by gary-trainsignal » Wed Apr 08, 2009 11:28 am

Also, do you know where the working client is calling the Google Website Optimizer code from on their confirmation page?

Thanks again
_________________
Gary Eimerman
Train Signal
Global Leader in Professional Computer Training
http://www.trainsignal.com
http://garyeimerman.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: How do I have script run after google analatyics e-commerce

Post by jmestep » Wed Apr 08, 2009 12:41 pm

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.)
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

gary-trainsignal
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Mon Dec 08, 2008 1:10 pm
Location: Rolling Meadows, IL
Contact:

Re: How do I have script run after google analatyics e-commerce

Post by gary-trainsignal » Thu Apr 09, 2009 9:58 pm

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. :twisted:
_________________
Gary Eimerman
Train Signal
Global Leader in Professional Computer Training
http://www.trainsignal.com
http://garyeimerman.com

Post Reply