Email Tracking Pattern

Track email opens and link clicks to measure engagement and improve email effectiveness with privacy-conscious analytics.

What's Included#

  • Open tracking with invisible pixel embedded before the closing body tag
  • Click tracking with redirect URLs and allowed-host validation
  • Per-email and per-campaign analytics with open rates and click-through rates
  • Top link reporting across campaigns
  • Privacy-conscious options with user opt-out and data anonymization
  • GDPR-compliant data export for user email tracking history

Usage#

Via CLI#

Loading code block...

Via AI Assistant#

Ask your AI assistant:

  • "Use the email tracking pattern from Bootspring"
  • "Apply the Bootspring email tracking pattern to my project"

Key Considerations#

  • Validate redirect URLs against an allowlist to prevent open redirect vulnerabilities
  • Respond quickly from tracking endpoints; do not await database writes in the pixel route
  • Handle tracking failures silently so they never break email rendering or delivery
  • Offer users an opt-out mechanism and anonymize old tracking data on a schedule
  • Never track sensitive links like unsubscribe or password reset URLs