diff --git a/scripts/workers/create_crtc_usf_campaign.py b/scripts/workers/create_crtc_usf_campaign.py index 93ce5bd..00d6128 100644 --- a/scripts/workers/create_crtc_usf_campaign.py +++ b/scripts/workers/create_crtc_usf_campaign.py @@ -39,6 +39,22 @@ CODE = "CANADA200" GUIDE_URL = "https://performancewest.net/guides/canada-carrier-guide.pdf" ORDER_URL = f"https://performancewest.net/order/canada-crtc?code={CODE}" +# Listmonk click tracking: a link is only registered (and clicks recorded) when +# its href carries the literal "@TrackLink" suffix at the very END of the URL -- +# Listmonk strips it and rewrites the link through lists.performancewest.net/link/. +# Campaign 509 originally shipped with raw hrefs and recorded ZERO clicks even +# though real visitors (and a phone-in lead) hit the order page -- the same +# mistake the trucking plan flagged ("Use @TrackLink on all CTAs"). _track() +# appends UTM params (so Umami also attributes the visit) + @TrackLink so both +# our analytics and Listmonk see the click. +UTM = "utm_source=listmonk&utm_medium=email&utm_campaign=crtc-usf-q3" + + +def _track(url: str) -> str: + """Append UTM params + Listmonk's @TrackLink marker to a CTA href.""" + sep = "&" if "?" in url else "?" + return f"{url}{sep}{UTM}@TrackLink" + def coupon_banner(): """Prominent $200-off banner with expiry.""" @@ -62,7 +78,7 @@ def guide_block(): '
Free guide: Canadian Wholesale Carrier & Vendor Reference
' '12 vetted Canadian wholesale partners for voice termination, SIP trunking, UCaaS, and both US and Canadian DIDs — the upstream vendors you’ll work with once your Canadian carrier is live, and which of them can provision US numbers.
' - f'Download the PDF →' + f'Download the PDF →' '