ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Shopping.com ROI Tracker Implementation
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Shopping.com ROI Tracker Implementation

 Post Reply Post Reply
Author
Message
whizzinpc View Drop Down
Newbie
Newbie
Avatar

Joined: 17-January-2006
Location: California
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote whizzinpc Quote  Post ReplyReply Direct Link To This Post Topic: Shopping.com ROI Tracker Implementation
    Posted: 03-October-2012 at 12:50pm
Can someone let me know if this code will work on the order complete page for Shopping.com's ROI Tracker. I think I have it right except i'm not sure about the OrderID.

<script type="text/javascript">
var _roi = _roi || [];

// Step 1: add base order details

_roi.push(['_setMerchantId', 'xxxxxx']); // required
_roi.push(['_setOrderId', '<%=(int(pOID)+scpre)%>']); // unique customer order ID
_roi.push(['_setOrderAmount', 'ptotal']); // order total without tax and shipping
_roi.push(['_setOrderNotes', 'pcomments']); // notes on order, up to 50 characters

// Step 2: add every item in the order
// where your e-commerce engine loops through each item in the cart and prints out _addItem for each
// please note that the order of the values must be followed to ensure reporting accuracy

_roi.push(['_addItem',
'psku', // Merchant sku
'pdescription', // Product name
'', // Category id
'', // Category name
'punitPrice', // Unit price
'pquantity' // Item quantity
]);

// Step 3: submit transaction to SDC ROI tracker

_roi.push(['_trackTrans']);
</script>
<script type="text/javascript" src="https://stat.dealtime.com/ROI/ROI2.js"></script>

Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 03-October-2012 at 1:11pm
Hi Art,

For "Step 1" you'd want:
// Step 1: add base order details

_roi.push(['_setMerchantId', 'xxxxxx']); // required
_roi.push(['_setOrderId', '<%=(pOrderNumber)%>']); // unique customer order ID
_roi.push(['_setOrderAmount', '<%=(ptotal)%>']); // order total without tax and shipping
_roi.push(['_setOrderNotes', '<%=(left(pcomments,50))%>']); // notes on order, up to 50 characters

For "Step 2", a modification to orderComplete.asp would be necessary. What you have there won't work at all, but even if corrected, at this point in the processing it would only pick up the values for the last item in the cart. To track the ROI at the item level, this bit of the script would need to be dynamically populated as orderComplete.asp loops through the items in the order, or (better) it could be generated straight off of pcCartArray.
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 03-October-2012 at 1:18pm
Oh, one more question: For this, would you want to push the complete order total (including shipping, taxes, etc.) or the subtotal before all of that?
Back to Top
whizzinpc View Drop Down
Newbie
Newbie
Avatar

Joined: 17-January-2006
Location: California
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote whizzinpc Quote  Post ReplyReply Direct Link To This Post Posted: 03-October-2012 at 1:27pm
It would be the subtotal before shipping, tax.
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 03-October-2012 at 1:49pm
Ok. PC doesn't have a subtotal, so we have to do some math here. So for "Step 1" you'd want:
<%
dim lngSubtotal
lngSubtotal = ptotal - (ptaxAmount + serviceHandlingFee + Postage)
lngSubtotal = money(lngSubtotal)
%>
<script type="text/javascript">
var _roi = _roi || [];

// Step 1: add base order details

_roi.push(['_setMerchantId', 'xxxxxx']); // required
_roi.push(['_setOrderId', '<%=(pOrderNumber)%>']); // unique customer order ID
_roi.push(['_setOrderAmount', '<%=(lngSubtotal)%>']); // order total without tax and shipping
_roi.push(['_setOrderNotes', '<%=(left(pcomments,50))%>']); // notes on order, up to 50 characters

Generating the content for "Step 2" would require some work, though.
Back to Top
whizzinpc View Drop Down
Newbie
Newbie
Avatar

Joined: 17-January-2006
Location: California
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote whizzinpc Quote  Post ReplyReply Direct Link To This Post Posted: 18-November-2014 at 1:45am
I wanted to bring this thread back to life. Can anyone help finish the code for the shopping.com ROI Tracker. Only thing not working is looping through all products in the order. The way the code is now only shows the last product in the order. So its reporting incorrectly.

            <!-- START Shopping.com ROI Tracking Code -->
            <script type="text/javascript">
            var _roi = _roi || [];
           
            // Step 1: add base order details
           
            _roi.push(['_setMerchantId', 'xxxxxx']); // required
            _roi.push(['_setOrderId', '<%=pOrderNumber%>']); // unique customer order ID
            _roi.push(['_setOrderAmount', '<%=pTotal%>']); // order total without tax and shipping
            _roi.push(['_setOrderNotes', '']); // notes on order, up to 50 characters
           
            // Step 2: add every item in the order
            // where your e-commerce engine loops through each item in the cart and prints out _addItem for each
            // please note that the order of the values must be followed to ensure reporting accuracy
           
            _roi.push(['_addItem',
            '<%=pIdProduct%>', // Merchant sku
            '<%=pdescription%>', // Product name
            '', // Category id
            '', // Category name
            '<%=punitPrice1%>', // Unit price
            '<%=pquantity%>' // Item quantity
            ]);
           
            // Step 3: submit transaction to ECN ROI tracker
           
            _roi.push(['_trackTrans']);
            </script>
            <script type="text/javascript" src="https://stat.dealtime.com/ROI/ROI2.js"></script>
            <!-- END Shopping.com ROI Tracking Code -->

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.