From 65ff6737da872702a967b5208512c2664e5dc23e Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Wed, 24 May 2023 19:23:37 -0400 Subject: [PATCH] set UTM info --- static/functions/_middleware.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/functions/_middleware.js b/static/functions/_middleware.js index f7862c5..8e2b69a 100644 --- a/static/functions/_middleware.js +++ b/static/functions/_middleware.js @@ -6,6 +6,9 @@ async function redirect_secondary_domains(context) { var secondary_domains = ['test.ewp.fyi', 'evan.pratten.ca', 'evan.warren.pratten.ca']; if (secondary_domains.includes(url.hostname)) { url.hostname = 'ewpratten.com'; + url.searchParams.set("utm_source", url.hostname); + url.searchParams.set("utm_medium", "redirect"); + url.searchParams.set("utm_campaign", "secondary_domains"); return Response.redirect(url, 302); }