- Posts: 57
- Thank you received: 0
Tracking Pixel (CJ) get cart values
- rockstaran
-
Topic Author
- Offline
Thank you in advance.
Please Log in or Create an account to join the conversation.
Here are some information regarding tracking of sales:
www.hikashop.com/en/support/forum/4-how-...omfirmaion-page.html
www.hikashop.com/en/support/forum/4-how-...tracking-system.html
The place where to put the modifications will depend on your payment method, either in the file "after_end" or the file "end" of the view "checkout" via the menu Display->Views.
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
I see views/checkout/tmpl
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
Please Log in or Create an account to join the conversation.
$app =& JFactory::getApplication();
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
$tax = $order->order_subtotal - $order->order_subtotal_no_vat + $order->order_discount_tax + $order->order_shipping_tax;
echo $order->order_full_price - $tax;
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
I tried the code above but it is not working for me. I have a php script (the second pixel you see), that puts the querystring in a text file, however nothing is showing up. I have had two conversions since i added the code and the pixel or url was not even called. I am assuming there may be an error in the code perhaps.
after_end.php
<?php
$app =& JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
$tax = $order->order_subtotal - $order->order_subtotal_no_vat + $order->order_discount_tax + $order->order_shipping_tax;
echo '<iframe src=" www.emjcd.com/tags/c?containerTagId=1153...54760&AMT1='.$order- >order_full_price - $tax.'&QTY1=1&ITEM1=Lead&CURRENCY=USD" height="1" width="1" frameborder="0" scrolling="no" name="Conversion tag">';
echo '<iframe src=" pixel.rockstaran.com/?pixel=OrderID_'.$o..._id.'_AMT1_'.$order- >order_full_price - $tax.'" height="1" width="1" frameborder="0" scrolling="no">';
end.php
$app =& JFactory::getApplication();
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
$tax = $order->order_subtotal - $order->order_subtotal_no_vat + $order->order_discount_tax + $order->order_shipping_tax;
echo '<iframe src=" www.emjcd.com/tags/c?containerTagId=1153...54760&AMT1='.$order- >order_full_price - $tax.'&QTY1=1&ITEM1=Lead&CURRENCY=USD" height="1" width="1" frameborder="0" scrolling="no" name="Conversion tag">';
echo '<iframe src=" pixel.rockstaran.com/?pixel=OrderID_'.$o..._id.'_AMT1_'.$order- >order_full_price - $tax.'" height="1" width="1" frameborder="0" scrolling="no">';
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
rockstaran wrote: Thank you,
I tried the code above but it is not working for me. I have a php script (the second pixel you see), that puts the querystring in a text file, however nothing is showing up. I have had two conversions since i added the code and the pixel or url was not even called. I am assuming there may be an error in the code perhaps.
after_end.php
<?php
$app =& JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
$tax = $order->order_subtotal - $order->order_subtotal_no_vat + $order->order_discount_tax + $order->order_shipping_tax;
echo '<iframe src=" www.emjcd.com/tags/c?containerTagId=1153...54760&AMT1='.$order- >order_full_price - $tax.'&QTY1=1&ITEM1=Lead&CURRENCY=USD" height="1" width="1" frameborder="0" scrolling="no" name="Conversion tag">';
echo '<iframe src=" pixel.rockstaran.com/?pixel=OrderID_'.$o..._id.'_AMT1_'.$order- >order_full_price - $tax.'" height="1" width="1" frameborder="0" scrolling="no">';
end.php
$app =& JFactory::getApplication();
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
$tax = $order->order_subtotal - $order->order_subtotal_no_vat + $order->order_discount_tax + $order->order_shipping_tax;
echo '<iframe src=" www.emjcd.com/tags/c?containerTagId=1153...54760&AMT1='.$order- >order_full_price - $tax.'&QTY1=1&ITEM1=Lead&CURRENCY=USD" height="1" width="1" frameborder="0" scrolling="no" name="Conversion tag">';
echo '<iframe src=" pixel.rockstaran.com/?pixel=OrderID_'.$o..._id.'_AMT1_'.$order- >order_full_price - $tax.'" height="1" width="1" frameborder="0" scrolling="no">';
Any ideas on the above?^
Please Log in or Create an account to join the conversation.
If you're editing them via the menu Display->Views, there are one view file per template, so make sure that you're editing the view file for the correct template.
Also, you can check the source of the end page to see if you see your HTML.
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
I confirmed that I am editing the correct two files via Display>Views, previously I had the code (that did not use tax) and it work functioning, when I updated the same view files the url's are not being called.
Is there a way to get to the end page without having to go through the checkout process?
Please Log in or Create an account to join the conversation.
If you're updating the correct file, then what is the HTML generated by that code ? Did you check it via the source of the page ?
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
-3.5527136788005E-15&QTY1=1&ITEM1=Lead&CURRENCY=USD" height="1" width="1" frameborder="0" scrolling="no" name="Conversion tag"></iframe>
-3.5527136788005E-15" height="1" width="1" frameborder="0" scrolling="no"></iframe></div>
A review of the back end code:
echo '<iframe src=" www.emjcd.com/tags/c?containerTagId=1153...54760&AMT1='.$order- >order_full_price - $tax.'&QTY1=1&ITEM1=Lead&CURRENCY=USD" height="1" width="1" frameborder="0" scrolling="no" name="Conversion tag">';
echo '<iframe src=" pixel.rockstaran.com/?pixel=OrderID_'.$o..._id.'_AMT1_'.$order- >order_full_price - $tax.'" height="1" width="1" frameborder="0" scrolling="no">';
Looks like something is breaking the string right before the tax variable or after. I think there is a problem in the math $order->order_full_price - $tax
Please Log in or Create an account to join the conversation.
$order->order_full_price - $tax
by:
round($order->order_full_price - $tax,2)
in your code.
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
<iframe src=" www.emjcd.com/tags/c?containerTagId=1153...M1=Lead&CURRENCY=USD " height="1" width="1" frameborder="0" scrolling="no" name="Conversion tag">
<iframe src=" pixel.rockstaran.com/?pixel=OrderID_290_AMT1_40.17 " height="1" width="1" frameborder="0" scrolling="no">
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- rockstaran
-
Topic Author
- Offline
- Posts: 57
- Thank you received: 0
Considering how you have to put a return URL, I dont know how we can grab those values.
Thank you for the help on this.
Please Log in or Create an account to join the conversation.
In SIM mode, it's also the after_end file so it should already work.
In AIM mode, it's the file "end". But you will have to add an "if" condition around your code so that you only do it for the authorize.net payment method. Otherwise, it would add the tracking pixel for paypal and firstdata before the payment has been made.
It should be something like that:
if($order->order_payment_method=='authorize'){
//display the tracking pixel
}
Please Log in or Create an account to join the conversation.