Step 1. Deploy the Click Tracking tag. Set Action Type to Click Tracking and enter your Program ID. This tag has to fire on every page to capture affiliate clicks from Webgains publishers. It loads main.min.js and initialises click detection.
Step 2. Set up order data variables. Create Data Layer Variables for ecommerce.transaction_id (Order Reference), ecommerce.value, ecommerce.currency, ecommerce.items, and a variable for your voucher code if you use one. Your Webgains account manager provides the Event ID, which is usually a static value you can hard-code.
Step 3. Deploy the Conversion tag. Create a second tag with Action Type Conversion and map each field. On firing it initialises the ITCVRQ queue, pushes program ID, order reference, value, currency, event ID, voucher code, items and language, then calls conversion().
Step 4. Sequence the tags. Use Tag Sequencing so main.min.js has loaded before the Conversion tag fires. On the confirmation page, set Click Tracking as the setup tag for Conversion.