Sub topic 2
Unique Links and Attributing Newsletter Signups
Assume you understand subscriber records, confirmation emails, and basic Python or SQL. This chapter focuses on attribution, the process of recording which source caused each signup.
Unique links and attribution
Give each referrer a unique code in a URL such as https://example.com/subscribe?ref=abc123. When a visitor opens the link, store the code in a first-party cookie or signup session. When the visitor confirms their email, save the referral relationship. Count confirmed subscribers, not just landing-page visits.
A code should identify the referrer without exposing private data. An HMAC, or keyed cryptographic hash, creates a code that is difficult to guess.
import base64
import hashlib
import hmac
def referral_code(subscriber_id: int, secret: bytes) -> str:
digest = hmac.new(
secret,
str(subscriber_id).encode(),
hashlib.sha256,
).digest()
return base64.urlsafe_b64encode(digest)[:10].decode()
code = referral_code(42, b"server-only-secret")
print(f"https://example.com/subscribe?ref={code}")Keep the code-to-subscriber mapping in your database. Record the signup time, campaign, confirmation status, and unsubscribe status. Do not award a referral reward until your defined quality and confirmation checks pass.
>callout note > Define one attribution window, such as 30 days, and apply it consistently. Decide in advance how you handle multiple referral codes.
Recommendation networks and cross-promotion
A recommendation network connects newsletters that suggest one another to relevant readers. A placement might appear after a welcome email, in a recommendation section, or during signup. Unlike an individual referral link, the relationship is usually reciprocal or managed through a shared platform.
Track each partner placement with a separate source code. Compare confirmed signups and later engagement by partner. A large number of registrations is not enough if those subscribers quickly unsubscribe.
Choosing and evaluating partners
Evaluate partners using audience fit, source quality, and operating reliability.
| Signal | What to check |
|---|---|
| Audience fit | Topic, geography, and reader intent |
| Conversion | Clicks to confirmed subscribers |
| Quality | Engagement and unsubscribe rate after 30 days |
| Reliability | Accurate reporting and clear consent practices |
Prefer a smaller partner whose readers remain engaged over a larger partner producing low-quality signups.
Exercise
A partner produces many signups but a high 30-day unsubscribe rate. Should you judge the partnership by signup volume alone?
Show answer
No. Compare confirmed signup volume with retention and engagement, then reduce or stop placements that do not produce valuable subscribers.