Hi everyone,
i'm having some problem with a conversion tag for an affiliate platform (Tradedoubler).
When i complete an order, the affiliate platform doesn't show that was completed by an affiliate program.
Before i start i have to specify that i use WHMCS Bridge on Wordpress.
This is the code that Tradedoubler gave to me
<!-- Start TradeDoubler Landing Page Tag Insert on all landing pages to handle first party cookie-->
<script language="JavaScript">
(function(i,s,o,g,r,a,m){i['TDConversionObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script', 'https://svht.tradedoubler.com/tr_sdk.js', 'tdconv');
</script>
<!-- End TradeDoubler tag-->
I insert this first part in the Google Tag Manager, with a variable to handle first part cookie. (as suggested by Tradedoubler)
Than this is the second part, for the conversion tag
<!-- Start TradeDoubler Conversion Tag Insert on confirmation Page -->
<script language="JavaScript">
tdconv('init', '2269371', {'element': 'iframe' });
tdconv('track', 'sale', {'transactionId':'[ORDER_NUMBER]', 'ordervalue':[ORDER_VALUE], 'voucher':'[VOUCHER_CODE]', 'currency':'EUR', 'event':404916});
</script>
<!-- End TradeDoubler tag-->
I installed this in complete.tpl in the suggested part of {if $ispaid}.
I also need to insert the total import of the order and the Order ID from WHMCS in the script.
From what i found on the internet, i've adapted the code as follows:
{if $ispaid}
<!-- Enter any HTML code which should be displayed when a user has completed checkout here -->
<!-- Common uses of this include conversion and affiliate tracking scripts -->
<!-- Start TradeDoubler Conversion Tag Insert on confirmation Page -->
{literal}
<script language="javascript">
tdconv('init', '2269371', {'element': 'iframe' });
tdconv('track', 'sale', {'transactionId':'{$orderid}', 'ordervalue':'{$total}', 'voucher':'', 'currency':'EUR','event':404916});
</script>
{/literal}
<!-- End TradeDoubler tag-->
{/if}
I had to insert {literal} because without it, the page became totally white...
Where is the error? It's two days that i try to resolve it 😫