[Skip to main content](#vessel-content)

#   Tracking sales from affiliate website

##

- **[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")**
- [![jacorr27's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/626-jacorr27 "View jacorr27's Profile") Topic Author
- [ Offline](/forum/user/626-jacorr27)

Less More

- Posts: 136
- Thank you received: 1
-
-

13 years 8 months ago -  13 years 8 months ago [\#91855](#91855) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  *[Tracking sales from affiliate website](/forum/4-how-to/78715-tracking-sales-from-affiliate-website#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 &quot;confirmed&quot; 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&#95;end.php file? 2 - Is my code below ok?")* was created by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")*

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? Code:

&lt;?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'); ?&gt; &lt;?php if(empty($this-&gt;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-&gt;html; } $this-&gt;nextButton = false; $app =&amp; JFactory::getApplication(); $order_id = $app-&gt;getUserState(HIKASHOP_COMPONENT.'.order_id'); $orderClass = hikashop::get('class.order'); $order = $orderClass-&gt;get($order_id); ?&gt; &lt;!-- Offer Conversion: BellaBuy ATD CPS --&gt; echo '&lt;iframe src="http://allthedealsaustralia.go2cloud.org/SLe?amount='.$order-&gt;order_full_price.'&amp;tracking='.$order_id." scrolling="no" frameborder="0" width="1" height="1"&gt;&lt;/iframe&gt;'; &lt;!-- // End Offer Conversion --&gt;

Last edit: 13 years 8 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4NzE1LXRyYWNraW5nLXNhbGVzLWZyb20tYWZmaWxpYXRlLXdlYnNpdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")**
- [![jacorr27's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/626-jacorr27 "View jacorr27's Profile") Topic Author
- [ Offline](/forum/user/626-jacorr27)

Less More

- Posts: 136
- Thank you received: 1
-
-

13 years 8 months ago -  13 years 8 months ago [\#91904](#91904) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Tracking sales from affiliate website](/forum/4-how-to/78715-tracking-sales-from-affiliate-website#91904 "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 &quot;confirmed&quot; 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&#95;end.php file? 2 - Is my code below ok?")*

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. Code:

&lt;?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'); ?&gt; &lt;?php $app =&amp; JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); }else{ echo $this-&gt;html; } $app =&amp; JFactory::getApplication(); $order_id = $app-&gt;getUserState(HIKASHOP_COMPONENT.'.order_id'); $orderClass = hikashop::get('class.order'); $order = $orderClass-&gt;get($order_id); ?&gt; &lt;!-- Offer Conversion: BellaBuy ATD CPS --&gt; echo '&lt;iframe src="http://allthedealsaustralia.go2cloud.org/SLe?amount=&lt;?php echo $order-&gt;order_full_price; ?&gt;&amp;order=&lt;?php echo $order-&gt;order_number; ?&gt;" scrolling="no" frameborder="0" width="1" height="1"&gt;&lt;/iframe&gt;'; &lt;!-- // End Offer Conversion --&gt;

Last edit: 13 years 8 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4NzE1LXRyYWNraW5nLXNhbGVzLWZyb20tYWZmaWxpYXRlLXdlYnNpdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

13 years 8 months ago [\#92105](#92105) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Tracking sales from affiliate website](/forum/4-how-to/78715-tracking-sales-from-affiliate-website#92105 "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 &quot;confirmed&quot; 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&#95;end.php file? 2 - Is my code below ok?")*

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: Code:

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

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4NzE1LXRyYWNraW5nLXNhbGVzLWZyb20tYWZmaWxpYXRlLXdlYnNpdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")**
- [![jacorr27's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/626-jacorr27 "View jacorr27's Profile") Topic Author
- [ Offline](/forum/user/626-jacorr27)

Less More

- Posts: 136
- Thank you received: 1
-
-

13 years 8 months ago [\#92111](#92111) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Tracking sales from affiliate website](/forum/4-how-to/78715-tracking-sales-from-affiliate-website#92111 "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 &quot;confirmed&quot; 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&#95;end.php file? 2 - Is my code below ok?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4NzE1LXRyYWNraW5nLXNhbGVzLWZyb20tYWZmaWxpYXRlLXdlYnNpdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")**
- [![jacorr27's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/626-jacorr27 "View jacorr27's Profile") Topic Author
- [ Offline](/forum/user/626-jacorr27)

Less More

- Posts: 136
- Thank you received: 1
-
-

13 years 8 months ago [\#92273](#92273) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Tracking sales from affiliate website](/forum/4-how-to/78715-tracking-sales-from-affiliate-website#92273 "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 &quot;confirmed&quot; 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&#95;end.php file? 2 - Is my code below ok?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4NzE1LXRyYWNraW5nLXNhbGVzLWZyb20tYWZmaWxpYXRlLXdlYnNpdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 8 months ago [\#92488](#92488) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Tracking sales from affiliate website](/forum/4-how-to/78715-tracking-sales-from-affiliate-website#92488 "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 &quot;confirmed&quot; 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&#95;end.php file? 2 - Is my code below ok?")*

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-&gt;order does not exists in the end file.
You would have to first create it like that:
&lt;?php $app = JFactory::getApplication();
$class = hikashop_get('class.order');
$this-&gt;order = $class-&gt;get($app-&gt;getUserState('com_hikashop.order_id'));
?&gt;

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](/forum/user/626-jacorr27 "View jacorr27's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4NzE1LXRyYWNraW5nLXNhbGVzLWZyb20tYWZmaWxpYXRlLXdlYnNpdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")**
- [![jacorr27's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/626-jacorr27 "View jacorr27's Profile") Topic Author
- [ Offline](/forum/user/626-jacorr27)

Less More

- Posts: 136
- Thank you received: 1
-
-

13 years 8 months ago [\#92519](#92519) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Tracking sales from affiliate website](/forum/4-how-to/78715-tracking-sales-from-affiliate-website#92519 "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 &quot;confirmed&quot; 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&#95;end.php file? 2 - Is my code below ok?")*

Thanks Nicolas.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4NzE1LXRyYWNraW5nLXNhbGVzLWZyb20tYWZmaWxpYXRlLXdlYnNpdGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.063 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
