-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Yes. Currently, users must manually track links and views in campaigns:
-
Link tracking: Users must either:
- Add
@TrackLinksuffix to URLs (e.g.,https://example.com@TrackLink) - Use
{{ TrackLink "url" }}template syntax - Check the "Track link?" checkbox in the rich text editor for each link
- Add
-
View tracking: Users must manually insert
{{ TrackView }}in email templates.
This is error-prone:
- Users forget to track links, leading to incomplete analytics
- Users forget to add
{{ TrackView }}, missing open tracking - Manual work slows campaign creation
- New users may not know about these features
Describe the solution you'd like
Automatically track all links and views without manual steps:
-
Automatic link tracking:
- Automatically wrap all URLs in campaign content with
{{ TrackLink }}during template compilation - Exclude system URLs (UnsubscribeURL, MessageURL, ManageURL, OptinURL) to avoid double-tracking
- Preserve existing manual
@TrackLinkor{{ TrackLink }}usage for backward compatibility
- Automatically wrap all URLs in campaign content with
-
Automatic view tracking:
- Automatically insert
{{ TrackView }}before the closing</body>tag (or at the end if no body tag exists) - Skip insertion if
{{ TrackView }}already exists in the template
- Automatically insert
Technical implementation approach
-
Auto TrackLink (in
models/campaigns.go-CompileTemplate()):- Parse HTML in campaign body using Go's
htmlpackage - Find all
<a href="...">tags - Replace URLs with
{{ TrackLink "url" . }}except for system URLs - Process after markdown conversion (if applicable) but before template compilation
- Parse HTML in campaign body using Go's
-
Auto TrackView (in
models/campaigns.go-CompileTemplate()):- Check if
{{ TrackView }}exists in template body - If not, append it before
</body>or at the end of the template - Process during template compilation phase
- Check if
Why this makes sense for the project
- Improves UX: removes manual steps and reduces errors
- Better analytics: ensures consistent tracking
- Backward compatible: existing manual tracking continues to work
- Aligns with common email marketing tools that auto-track by default
- Low risk: changes are in template compilation, not core functionality
Additional context
- The rich text editor already defaults the "Track link?" checkbox to
true(line 277 inRichtextEditor.vue), indicating intent for tracking by default - Current tracking infrastructure supports this; we just need to automate the application
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request