Question:
How do I properly integrate TradeTracker (affiliate management platform) conversion tracking on my Wix website?
Product:
Wix Editor
What are you trying to achieve:
I’m trying to connect my Wix website to TradeTracker so that conversions (e.g. purchases ) are accurately tracked. TradeTracker provided me with a tracking script (including a conversion pixel), and I want to make sure it’s implemented in the right place. Currently, conversions are not being recorded, so I think something might be wrong with my setup.
What have you already tried:
– I added the TradeTracker HTML iFrame/script via the Settings > Custom Code > Tracking & Analytics section in Wix.
– I also tried placing the script only on my “Thank You” page after a conversion event.
– I searched the Wix Help Center and TradeTracker documentation, but couldn’t find a Wix-specific integration guide.
– I’ve tested the tracking using browser tools but don’t see any network request to TradeTracker.
Additional information:
– I’m using the classic Wix Editor (not Wix Studio).
– My website is a simple product landing page with a form that redirects to a Thank You page.
1 Like
Here’s How to Do It Right in Wix Editor:
- Understand the Script Placement
- Find the Right Page in Wix
Method for Wix Stores: Use “onOrderPai” Velo Event
- Enable Velo (Dev Mode)
- Add a backend events file
- Use or in code to call Trade Tracker tracking pixel on order complete:
Hi and thank you so much !
I removed all other custom scripts and just placed this new back-end events.js
But the order still returns no ordernumber as a reference and still no order amount…
Any chance you can see what is going wrong?
Thank you so much!
import { fetch } from ‘wix-fetch’;
//
Temporary log for debugging
console.log(‘
Order received: wixStores_onOrderPaid triggered’);
export function wixStores_onOrderPaid(event) {
console.log(‘
Order details:’, JSON.stringify(event));
const order = event;
// Use order ID or number, fallback to ‘unknown’
const transactionId = order._id || order.number || ‘unknown’;
// Total including VAT
const totalInclVat = order.totals?.total || 0;
// Shipping costs
const shipping = order.totals?.shipping || 0;
// Discount amount
const discount = order.totals?.discount || 0;
// Coupon code if available
const coupon = order.coupon?.code || ‘’;
// Calculate order amount excluding VAT (assuming 21% VAT)
const orderAmount = ((totalInclVat - discount - shipping) / 1.21).toFixed(2);
// Construct the TradeTracker conversion pixel URL
const trackingPixelUrl = https://track.tradetracker.net/ttconversion.php?campaignID=28386&productID=51770&transactionID=${transactionId}&amount=${orderAmount}&quantity=1&vc=${coupon}&descrMerchant=&descrAffiliate=¤cy=EUR&type=sales
;
// Send GET request to the tracking pixel URL
return fetch(trackingPixelUrl, {
method: ‘get’
})
.then(() => {
console.log(‘
TradeTracker pixel sent:’, trackingPixelUrl);
})
.catch((err) => {
console.error(‘
Error sending TradeTracker pixel:’, err);
});
}
wixStores _onOrderPaid() is deprecated.
Use wixEcom_onOrderPaymentStatusUpdated() and call the tracker URL when event.data.order.paymentStatus
= 'PAID'
.
Also, the fields you had previously used weren’t mapped correctly. Go through the documentation, study the structure of your event’s payload and ensure all values are correctly fetched through your code before constructing the URL.
1 Like
Thank you so much! Going to try that now! Will let you know if I got it working