Tracking sales from affiliate website

  • Posts: 136
  • Thank you received: 1
11 years 1 month ago #91855

Hi guys,

I am trying to insert a tracking code for sales that come from an affiliate site. I am a novice so I probably have done something wrong here.

I would only like to track sales that have the status "confirmed" and have modified the code of my checkout / end.php file to the below.

1 - Is this the right file to be changing or should I modify the checkout / after_end.php file?
2 - Is my code below ok?

<?php
/**
 * @package		HikaShop for Joomla!
 * @version		1.5.8
 * @author		hikashop.com
 * @copyright	(C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php
if(empty($this->html)){
	echo JText::_('THANK_YOU_FOR_PURCHASE'). 'Your transaction has been completed, and a receipt for your purchase has been emailed to you. If you do not receive it please email enquiries@bellabuy.com.au.';
}else{
	echo $this->html;
}
$this->nextButton = false;

$app =& JFactory::getApplication();
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->get($order_id);
?>

<!-- Offer Conversion: BellaBuy ATD CPS -->
echo '<iframe src="http://allthedealsaustralia.go2cloud.org/SLe?amount='.$order->order_full_price.'&tracking='.$order_id." scrolling="no" frameborder="0" width="1" height="1"></iframe>';
<!-- // End Offer Conversion -->

Last edit: 11 years 1 month ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 1
11 years 1 month ago #91904

I have also tried inputting the following code on my after_end.php page - with no luck during the testing process.

Any advice would be great.

<?php
/**
 * @package		HikaShop for Joomla!
 * @version		1.5.8
 * @author		hikashop.com
 * @copyright	(C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php
$app =& JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
}else{
echo $this->html;
}

$app =& JFactory::getApplication();
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->get($order_id);
?>

<!-- Offer Conversion: BellaBuy ATD CPS -->
echo '<iframe src="http://allthedealsaustralia.go2cloud.org/SLe?amount=<?php echo $order->order_full_price; ?>&order=<?php echo $order->order_number; ?>" scrolling="no" frameborder="0" width="1" height="1"></iframe>';
<!-- // End Offer Conversion -->

Last edit: 11 years 1 month ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #92105

Hi,

"echo" is a PHP function and you code is not in a PHP block so it could not work properly.
The "after_end" view have already the order is in content, so you can use this code:

<?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
?>
<!-- Offer Conversion: BellaBuy ATD CPS -->
<iframe src="http://allthedealsaustralia.go2cloud.org/SLe?amount=<?php echo $this->order->order_full_price; ?>&order=<?php echo $this->order->order_number; ?>" scrolling="no" frameborder="0" width="1" height="1"></iframe>
<!-- // End Offer Conversion -->

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 1
11 years 1 month ago #92111

Thank you Jerome.

I have placed that code on the "after_end" view and the affiliate site is still not picking up any conversions.

Is there somehow I can test to see what's going on?

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 1
11 years 1 month ago #92273

Hi Jerome,

I have changed a setting on paypal and this is code is now working on my after_end.php page.

We are using paypal as our only payment method.

Our problem now is that the user is required to click the "return to bellabuy" button to trigger the after_end page.

Is there another page that I could place this code that would track the sale?

I'm worried that if I place this code on the checkout / end.php file that any sales that are in the cancelled or created status would still trigger a conversion. Would that happen?

Also, would the same code work on the end.php file?

Please Log in or Create an account to join the conversation.

  • Posts: 81511
  • Thank you received: 13066
  • MODERATOR
11 years 1 month ago #92488

Hi,

That's indeed the case. If you place it in the end file, any sales that are in the cancelled or created status would trigger a conversion.

That code would have to be slightly changed on the end file as $this->order does not exists in the end file.
You would have to first create it like that:
<?php $app = JFactory::getApplication();
$class = hikashop_get('class.order');
$this->order = $class->get($app->getUserState('com_hikashop.order_id'));
?>

Unfortunately, there are only the after_end and the end file where you can put your tracking code.

The following user(s) said Thank You: jacorr27

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 1
11 years 1 month ago #92519

Thanks Nicolas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.066 seconds
Powered by Kunena Forum