Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Conversion tracking with one tag per item in order

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-20-2014, 03:01 PM
 
paradosso paradosso is offline
 

Newbie
  
Join Date: Jan 2014
Posts: 1
 

Default Conversion tracking with one tag per item in order

I am trying to implement conversion tracking at the item level with the digital agency RKG.

One peculiarity they have is they require to fire one pixel for every item instead of one pixel with multiple parameters like item1 qty1 item2 qty2.

So for example if an order comprises two items, two pixels should be fired like this:

Code:
<img src="https://www.rkdms.com/order.gif?mid=acme&oid=12345& lid=1&iid=WIDGETSML&icent=1099&iqty=10&iname=Small%20Wid get&ts=20030101152000" height="1" width="1"> <img src="https://www.rkdms.com/order.gif?mid=acme&oid=12345& lid=2&iid=WIDGETLRG&icent=2099&iqty=4&iname=Large%20Widg et&ts=20030101152000" height="1" width="1">

I know that I can access and interpolate the variables using a foreach loop in order_message.tpl but I don't know how to output them in separate tags and I was hoping someone could help here.

Here are the parameters I need:

oid: orderid
lid: incremental index 1, 2, ...
iid: productcode (SKU id)
ts: timestamp in format YYYYMMDDHHMMSS
icent: price in cents
iqty: item quantity
iname: url encode

here's also the magento code that produces the desired output:

Code:
<!-- Start RKG Pixel Tracking Code --> <?php //loading the order object. $orderObj = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId()); //get all the items included on the order. $orderItems = $orderObj->getAllItems(); $lid = 0; $ts = date('YmdHis'); //do a loop to get each item. foreach($orderItems as $item) { $lid = $lid + 1; echo '<img src="https://www.rkdms.com/order.gif?mid=performancetruck&oid=', $this->getOrderId(), '&lid=', $lid, '&iid=', $item->getSku(), '&icent=', $item->getPrice(), '&iqty=', $item->getQtyOrdered(), '&iname=', $item->getName(), '&ts=', $ts, '" height="1" width="1">'; } ?> <!-- End RKG Pixel Tracking Code -->

Any help is appreciated.
__________________
4.4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:12 AM.

   

 
X-Cart forums © 2001-2020