Jump to content

adding affiliate tracking code


snake

Recommended Posts

I have signed up with AWIN.com and need to add their tracking code in WHMCS. Can anyone tell me how/where to add this?

I want to do it in such a way that it won't get broken/overwritten every time I update whmcs.

 

here are the instructions.

Order Confirmation Page

  1. Add the tracking code snippet to your order confirmation page.
    This enables us to send accurate transaction data and correctly attribute sales and commission to your partners.
  2. Replace the placeholders in {{ brackets }} with the variables your site uses for that specific information.
    To find out more about each placeholder, please click on the examples below the code.
<!-- Fall-back Conversion Pixel - Mandatory -->
<img src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=45669&amount={{order_subtotal}}&cr={{currency_code}}&ref={{order_ref}}&parts=DEFAULT:{{sale_amount}}&vc={{voucher_code}}&ch=aw" border="0" width="0" height="0">

<!-- Conversion Tag - Mandatory -->
<script type="text/javascript">
//<![CDATA[ /*** Do not change ***/
var AWIN = {};
AWIN.Tracking = {};
AWIN.Tracking.Sale = {};
/*** Set your transaction parameters ***/
AWIN.Tracking.Sale.amount = "{{order_subtotal}}";
AWIN.Tracking.Sale.orderRef = "{{order_ref}}";
AWIN.Tracking.Sale.parts = "DEFAULT:{{sale_amount}}";
AWIN.Tracking.Sale.voucher = "{{voucher_code}}";
AWIN.Tracking.Sale.currency = "{{currency_code}}";
AWIN.Tracking.Sale.channel = "aw";
//]]>
</script>

 

Link to comment
Share on other sites

  • 1 year later...
  • WHMCS Technical Analyst

Hi there,

You should be able to do this, via a custom hook.  The hook point to use would be the ShoppingCartCheckoutCompletePage that executes when the Complete Page is displayed on checkout. 

We also have an example of how this can be implemented, in another thread (In particular, see “2. Place your tracking code script in a Hook.”):

Place your tracking code script in a custom hook, should prevent it from being overwritten whenever you update your WHMCS.

For further information, visit:
https://developers.whmcs.com/hooks/getting-started/
https://developers.whmcs.com/hooks/hook-index/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated