Your software
My Mautic version is: 5.2.7
My PHP version is: 8.3
My Database type and version is: mariadb operator
Your problem
My problem is: Email links are not properly tracking clicks
These errors are showing in the log: There are no errors in the logs about redirecting with NULL as the end result.
Steps I have tried to fix the problem: I’ve spent an insane amount of time dealing with ingress and other options. The database is showing the links and that they’re being clicked, but the data is filling with NULL instead of with the proper contact ID.
±-----±--------±--------------------±------------------------±---------±-----+
| url | lead_id | date_hit | tracking_id | email_id | code |
±-----±--------±--------------------±------------------------±---------±-----+
| NULL | NULL | 2025-11-21 21:19:55 | 44hize6yv3s3oosahn8hybj | NULL | 200 |
| NULL | NULL | 2025-11-21 21:07:44 | 3st0t920edth9nwlb6yryfw | NULL | 200 |
| NULL | NULL | 2025-11-21 21:07:41 | el4wfnqey1q7urb1yyz2lpe | NULL | 200 |
| NULL | NULL | 2025-11-21 20:56:49 | ved041wexteiposyeucslzv | NULL | 200 |
±-----±--------±--------------------±------------------------±---------±-----+
Link clicks are NOT associating with your contact (lead_id = NULL)
-
URLs are not being captured (url = NULL)
-
Points for link clicks WON’T work because the system doesn’t know WHO clicked
The root cause: Mautic is creating redirect entries with raw token text instead of actual URLs.
The Real Solution
We need to fix how Mautic processes contact field tokens in email links. This is a known bug in Mautic that’s been reported but not fully fixed. Let me search for the actual solution:
Mautic 5 contact field tokens href email links not replacing bug fix
10 results
Incorrect url redirection (/r/) when using {contactfield} in links send via e-mail · Issue #5345 · mautic/mautic
Fix compatibility between tokens and redirect links by alanhartless · Pull Request #6260 · mautic/mautic
How to preserve leadfield/contactfield used in href links sent via e-mail? - General Discussion - Mautic Forums
Email with a token as part of link href is corrupted when sent · Issue #3825 · mautic/mautic
Custom Field Tokens not Populated in Trackable URLs · Issue #9407 · mautic/mautic
Owner Tokens / Variables not replaced in E-Mail · Issue #12310 · mautic/mautic
Unable to use company field Mautic tokens in email template · Issue #3324 · mautic/mautic
Regression for editing links in an Email: can’t change link properties anymore · Issue #13362 · mautic/mautic
link in email based on token not working · Issue #6268 · mautic/mautic
Tokens in email URLs not replaced if email tracking is enabled · Issue #12047 · mautic/mautic
FOUND IT! This is a well-documented Mautic bug that’s been around for YEARS. The issue occurs because Mautic creates tracking tokens before it replaces contact field tokens, causing links with tokens to lose their protocol and not be tracked properly GitHubGitHub.
Tokens in email URLs are not replaced when email tracking is enabled - the tracking redirect gets created with the raw token text instead of the actual value GitHub.
The Current State in Mautic 5.x
Custom field tokens don’t populate in trackable URLs - when trackable URLs are enabled, contact fields don’t populate, but they DO work when tracking is disabled GitHub.
That is what I found about these redirect links that are supposed to track points. The question is - how do I fix this so that the points will get awarded to the correct contact when an email link is clicked. The Mautic redirects are working correctly from the email to the link clicked. I see they are registering, but no points are getting awarded.
Is there a fix?
thank you,
Jody