GOLD R8 - Google AdWords Conversion Tracking

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
JaminLeather
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Fri Feb 05, 2010 9:37 am
Location: Myrtle Beach, South Carolina
Contact:

GOLD R8 - Google AdWords Conversion Tracking

Post by JaminLeather » Thu Oct 30, 2014 11:49 am

I am using the following code on our Receipt.aspx page:

Code: Select all

<!-- Google Code for Purchase Conversion Page -->
	<script type="text/javascript">
	/* <![CDATA[ */
	var google_conversion_id = 1234567890;
	var google_conversion_language = "en_US";
	var google_conversion_format = "1";
	var google_conversion_color = "666666";
	var google_conversion_label = "Purchase";
	if (<%= totalValue %>) {
	var google_conversion_value = <%= totalValue %>;
	}
	var google_conversion_currency = "USD";
        var google_remarketing_only = false;
	/* ]]> */
	</script>
	<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
	</script>
	<noscript>
	<img height=1 width=1 border=0 src="//www.googleadservices.com/pagead/conversion/1234567890/?value=<%=totalValue%>&label=Purchase&script=0">
	</noscript>
	</body>
I need to track the transaction-specific conversion value. Has anyone gotten this to work with AbleCommerce? I have seen other posts on this but none for GOLD R8.

Code: Select all

if (<%= totalValue %>) {
	var google_conversion_value = <%= totalValue %>;
	}
I need to find <%= totalValue %> for the receipt page. For now, I have reverted back to the original code with a specific value for google_conversion_value instead of the dynamic value.

Thanks in advance!
Simone
Jamin' Leather Catalog Outlet
http://www.jaminleather.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: GOLD R8 - Google AdWords Conversion Tracking

Post by mazhar » Fri Oct 31, 2014 4:22 am

Edit your Website/Checkout/Reciept.aspx.cs file and locate following code

Code: Select all

Order _Order = null;
and update it like

Code: Select all

Order _Order = null;

        public Order Order
        {
            get 
            {
                if(_Order == null)
                    _Order = OrderDataSource.Load(AbleCommerce.Code.PageHelper.GetOrderId());
                return _Order;
            }
        }
Now in Reciept.aspx file where you need totalValue use following code

Code: Select all

<%=Order.TotalCharges.ToString("F2") %>

JaminLeather
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Fri Feb 05, 2010 9:37 am
Location: Myrtle Beach, South Carolina
Contact:

Re: GOLD R8 - Google AdWords Conversion Tracking

Post by JaminLeather » Fri Oct 31, 2014 9:15 am

Worked like a charm! Thanks so much!
Jamin' Leather Catalog Outlet
http://www.jaminleather.com

Post Reply