When implementing Awin via Google Tag Manager (GTM), the integration of both client-side and server-side Awin Tracking is mandatory. You may well find a solution for your specific use case in the implementation examples and custom solutions below. Naturally, there may be various possible approaches.
Custom Solutions Custom Code Examples
Discover a solution for your use case in the following compilation. In some cases, it can be helpful to use customer-specific solutions via custom code.
Setup Data Layer Variables
Example for custom specific Data Layer Setup
Place the following code on the confirmation page of your website (the code must be positioned above the Google Container code on the page):
<script>
dataLayer = [{
'transactionTotal': "{transactionTotal}",
'transactionCurrency': "{transactionCurrency}",
'transactionID': "{transactionID}",
'transactionPromoCode': "{transactionPromoCode}",
'event': "awin.dl.ready"
}];
</script>The text in { brackets } are placeholders – it will need to be replaced with the variables your site uses for the following information:
transactionTotal: The total cost of the sale (before or after VAT/delivery)
transactionCurrency: The ISO currency code for the currency that was used on the transaction
transactionID: The unique order reference associated the transaction
transactionPromoCode: The voucher code used with the transaction (optional)
You may wish to use PHP to load these variables. Alternatively, if you are using a third-party eCommerce platform, their support team may be able to provide you with the variables to use.
Example
If a customer purchases a product for £5.99 using the voucher code 'HALFPRICE', the code should load on the confirmation page as:
<script>
dataLayer = [{
'transactionTotal': "5.99",
'transactionCurrency': "GBP",
'transactionID': "4-815162342",
'transactionPromoCode': "HALFPRICE",
'event': "awin.dl.ready"
}];
</script>Publishing Tags Within Google Tag Manager
When you have implemented all of the required functionality into the Tag Manager interface, click Publish to apply the changes to your site.
Array For Custom Parameters
Custom JavaScript to create an array for custom parameters:
function() {
return [
"{{value1}}",
"{{value2}}",
"{{value3}}",
];
}Shop Content First Example
In cases where data is missing (resulting in "undefined" values) or loading delays occur, it can help to load the Awin ConversionTag or MasterTag only after all page content has finished loading. This ensures that all order data is available before being transmitted to Awin. GTM offer “content first” trigger events:
"DOM Ready" or
"Window Loaded".

Related links for this loading event topic:
https://support.google.com/tagmanager/answer/7679319?hl=en
https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
Mastertag Integration In Single-Page Application
This solution will work if page url is changing when user moves to different sections of the Single-page Application (sometimes short: SPA).
use case: mastertag integration in single-page application using Google Tag Manager
Create a Journey Tag to fire on a Landing page but not checkout page
Create a History Change Trigger with exception (don't fire on checkout page)

Create a Custom HTML Tag, name it Awin Mastertag - History Change and use the code below (replace the XXXX with Advertiser ID)
<script>
AWIN.Tracking.scriptAppend('https://www.dwin1.com/XXXX.js?cb=' + Math.floor(Date.now() / 1000));
</script>Add the History Change Trigger to Awin Mastertag - History Change and save the tag

Removing VAT Or Shipping Costs From Amount
Use case: reduce order total value by the amount of Value Added Tax (VAT) and shipping costs (target: net amount).
Create a new Custom JavaScript

Let’s make a code that takes the DataLayer variables for the total revenue, the VAT and the shipping fee, and run a subtraction equation using the “-“ (minus) JavaScript Subtraction Operator.
Use the following code as a base, and edit to your needs:
function(){
// UPDATE the {{}} variables to your DataLayer variables.
var revenue = {{Transaction Revenue}};
var vat = {{Transaction VAT}};
var shipping = {{Transaction Shipping}};
var totalAmount = revenue - (shipping + vat);
return totalAmount.toFixed(2);
}The above code will return the resulting value from the subtraction equation, rounded with 2 decimal cases using the .toFixed( ) method.
Then simply use this custom JavaScript variable in the Awin Conversion Tag.