TackLink doesn't work with complex URL
Version:
- listmonk: v5.0.1
- OS: Binary
Hello,
I'm facing the same issue with tracklink feature (same version). But my struggle is with some complexes characters in link i want to be tracked. With something like "htts://foo.bar/search?fulltext=campus&f[0]=themes:2&f[1]=themes:1706". The traclking checkbox add "https://github.com/Tracklink" at the end of but it's not tracked at all and generate bad redirection ("https://github.com/Tracklink" is still in the end of the URL if we go to the page with the link created). I can register and send the campagin but, the link is still htts://foo.bar/search?fulltext=campus&f[0]=themes:2&f[1]=themes:1706@TrackLink in the receiving mail. So the link is not functionnal (because of mismatch url)... It seems like the tracked link is not even register into DB (no trace into "links" table).
And if i want to wrap the link as "{{ TrackLink "htts://foo.bar/search?fulltext=campus&f[0]=themes:2&f[1]=themes:1706"}}", i can't register campaign content because of system error:
[...] error compiling message: template: content:1: unexpected "%" in command".
The wrapping error
Thanks
hm, I'm unable to reproduce this. Please try this code snippet in your campaign.
<p>Test</p>
<p>
<a href="{{ TrackLink "https://google.com/search?fulltext=campus&f[0]=themes:2&f[1]=themes:1706" }}">Link 1</a>
</p>
<p>
<a href="https://google.com/search?fulltext=campus&f[0]=themes:2&f[1]=themes:1706@TrackLink">Link 2</a>
</p>
Example for this rendering fine in v5.0.1
Thx @knadh , I tried your solution and it worked. The problem seems to occur with the "text rich" feature and url encoded characters apparently (i've run some tests). "%" maybe ?
With text rich :
<p>
<a href="https://google.com/search?fulltext%3Dcampus%26f%5B0%5D%3Dthemes%3A2%26f%5B1%5D%3Dthemes%3A1706@TrackLink">Link 1</a>
</p>
<p>
<a href="https://google.com/search?fulltext=campus&f[0]=themes:2&f[1]=themes:1706@TrackLink">Link 2</a>
</p>
- Link 1 doesn't work as expected. Link send in campagain is still "https://google.com/search?fulltext%3Dcampus%26f%5B0%5D%3Dthemes%3A2%26f%5B1%5D%3Dthemes%3A1706@TrackLink" not "listmonk.url.com/00000-0000....". So untracked.
- Link 2 is ok
With text rich :
<p>
<a href="{{ TrackLink "https://google.com/search?fulltext%3Dcampus%26f%5B0%5D%3Dthemes%3A2%26f%5B1%5D%3Dthemes%3A1706@TrackLink" }}">Link 1</a>
</p>
<p>
<a href="https://google.com/search?fulltext=campus&f[0]=themes:2&f[1]=themes:1706@TrackLink">Link 2</a>
</p>
- Link 1 doesn't Work at all. impossible to register content cause of listmonk error :
Hi @aurelien-ephe,
I encountered the same issue. There are two ways to add tracking to a URL in Listmonk:
- The method you're using — appending @TrackLink at the end of each URL — usually works well, but it can fail when the URL is complex or contains certain characters.
- When that happens, you can use the alternative method: {{ TrackLink "https://link.com" }} as described in the Listmonk Templating Docs.
In my case, switching to the TrackLink function resolved the issue.
Hope this helps!
Hello @psaldias ,
Thank for your reply and i've already change the method of tracking link when one doens't work. But There's still an error with some specials characters and the tracklink checkbox feature doesn't work in certain case.
The probleme is i've some users whom are campaign senders on the plateform, that aren't unable (for some reasons...) to switch from method to another when one failed. Then they register ticket incident because "they don't understand why there trackinlink doesn't work...". to my opinion, if the feature exist, it must work regardless of the method and "IT skills" of the user.
Best regards