Capture awc at the first landing touchpoint
Awin uses the awc click identifier to connect the conversion to the original affiliate click. TrackLayer should capture awc from the landing page query string, store it in a first-party cookie or server session, and forward it into the checkout completion event. If the shopper lands without awc, do not synthesize one. Send the conversion only when a real value exists.
// Landing page middleware or edge handler
const url = new URL(request.url);
const awc = url.searchParams.get("awc");
if (awc) {
response.cookies.set("tl_awc", awc, {
httpOnly: true,
sameSite: "Lax",
secure: true,
maxAge: 60 * 60 * 24 * 30,
path: "/",
});
}
// Later, on order confirmation
const awinClickId = request.cookies.get("tl_awc")?.value ?? null;