Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Adding Affiliate Code Rate Topic   - - - - -

 
  • jain1980
  • Senior Member
  • Members
  • Join Date: 16-Dec 08
  • 300 posts

Posted 29 July 2019 - 09:39 AM #1

Hi Folks

 

We are trying to add affiliate code to track all affiliate links. Below is the code given by the Affiliate software company that we should include in cs-cart. We need to track conversions as well as the order amount.

 

What cs-cart variables should we use to replace the variables 'Unique Conversion Id' and 'Conversion Amount' in the below code?

 

 

*******************************************

 

Place the below code in the head of every page of our website
 
<script src="https://script.tapfi.../tapfiliate.js"type="text/javascript" async></script>
<script type="text/javascript">
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
  
  tap('create', '10939-47cd25', { integration: "javascript" });
  tap('detect');
</script>
 
 
Place the below code in thank you page
 
<script src="https://script.tapfi.../tapfiliate.js"type="text/javascript" async></script>
<script type="text/javascript">
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
 
  tap('create', '10939-47cd25', { integration: "javascript" });)
;
  tap('conversion', 'Unique Conversion Id', Conversion Amount);
</script>
 

*******************************************

 

Thnx 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 29 July 2019 - 02:01 PM #2

- enable My changes addon
 
- create the following file
 
design/themes/responsive/templates/addons/my_changes/hooks/index/head_scripts.post.tpl
 
 
{literal}
<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async data-no-defer></script>
<script type="text/javascript">
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
  
  tap('create', '10939-47cd25', { integration: "javascript" });
  tap('detect');
</script>
{/literal}
 
- create the following file
 
design/themes/responsive/templates/addons/my_changes/hooks/checkout/order_confirmation.post.tpl
 
 
{literal}

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async data-no-defer></script>
<script type="text/javascript" data-no-defer>
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
 
  tap('create', '10939-47cd25', { integration: "javascript" }););
{/literal}
  tap('conversion', '{$order_info.order_id}', '{$order_info.total}');
</script>
 
- clear cache
 
- check result
 
(!) Not tested

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jain1980
  • Senior Member
  • Members
  • Join Date: 16-Dec 08
  • 300 posts

Posted 29 July 2019 - 03:32 PM #3

Will try this and see if it works. Thanks e-com labs.  :-)  



 
  • jain1980
  • Senior Member
  • Members
  • Join Date: 16-Dec 08
  • 300 posts

Posted 31 July 2019 - 12:16 PM #4

This didn't work. May be we did it wrong or may be some other variables are to be used.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 31 July 2019 - 01:45 PM #5

Did you clear cache? Try to remove the var/cache directory manually


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.