mail: CRTC/USF campaign — add @TrackLink + UTM to CTAs (was recording 0 clicks)

Campaign 509 (CRTC USF Q3, 4,156 sent) shipped with raw <a href> URLs, so
Listmonk never registered the links and recorded ZERO clicks -- even though
Umami logged the real order-page visits AND a carrier phoned in after clicking.
Same mistake docs/fmcsa-trucking-plan.md already flagged ("Use @TrackLink on all
CTAs"); the trucking campaigns do it, the CRTC one didn't.

Listmonk only tracks a link when its href ends with the literal @TrackLink marker
(it strips it and rewrites through lists.performancewest.net/link/). Added a
_track() helper that appends UTM params (so Umami attributes the visit too) +
@TrackLink, applied to both the primary order CTA and the guide-PDF download.

The running campaign 509's body was also patched live in the DB (same two links)
so its remaining sends record clicks. Future CRTC campaigns get it from source.
This commit is contained in:
justin 2026-06-19 10:05:01 -05:00
parent 707d538847
commit 433b10ce98

View file

@ -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():
'<td style="vertical-align:middle;">'
'<p style="margin:0 0 4px;font-family:Arial,sans-serif;font-size:15px;font-weight:700;color:#1a2744;">Free guide: Canadian Wholesale Carrier &amp; Vendor Reference</p>'
'<p style="margin:0 0 10px;font-family:Arial,sans-serif;font-size:13px;color:#4a5568;line-height:1.6;">12 vetted Canadian wholesale partners for voice termination, SIP trunking, UCaaS, and <strong>both US and Canadian DIDs</strong> &mdash; the upstream vendors you&rsquo;ll work with once your Canadian carrier is live, and which of them can provision US numbers.</p>'
f'<a href="{GUIDE_URL}" style="display:inline-block;font-family:Arial,sans-serif;font-size:14px;font-weight:700;color:#1e40af;text-decoration:none;">Download the PDF &rarr;</a>'
f'<a href="{_track(GUIDE_URL)}" style="display:inline-block;font-family:Arial,sans-serif;font-size:14px;font-weight:700;color:#1e40af;text-decoration:none;">Download the PDF &rarr;</a>'
'</td></tr></table>'
'</td></tr></table>'
)
@ -116,7 +132,7 @@ def build_body():
"Full corporate binder, delivered digitally &mdash; plus a Canadian business-banking referral",
)
+ coupon_banner()
+ cta("Start your Canadian carrier setup &mdash; $200 off &rarr;", ORDER_URL)
+ cta("Start your Canadian carrier setup &mdash; $200 off &rarr;", _track(ORDER_URL))
+ guide_block()
+ PS(f"Questions about moving your VoIP onto a Canadian carrier? {CONTACT}. The {CODE} discount is good through Friday at 11:59pm ET.")
+ P("&mdash; Performance West")