Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link tracking not working on template variables #667

Closed
charl4e opened this issue Jan 19, 2022 · 4 comments
Closed

Link tracking not working on template variables #667

charl4e opened this issue Jan 19, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@charl4e
Copy link

charl4e commented Jan 19, 2022

  • listmonk: 2.0.0
  • OS: Ubuntu

When you try to apply link tracking to a template variable, it either fails the validation or it simply doesn't convert the link to a tracked link.

I've tried to apply the following:

<a href="{{ .Subscriber.Attribs.jobs.link }}@TrackLink">View</a>

<a href="{{ TrackLink ".Subscriber.Attribs.jobs.link" }}">View</a>

<a href="{{ TrackLink {{ .Subscriber.Attribs.jobs.link }} }}">View</a>

<a href="{{ .Subscriber.Attribs.jobs.link@TrackLink }}">View</a>

Is there perhaps a way to track links generated from the attributes on a subscriber? Feels like I'm missing something simple here.

@charl4e charl4e added the bug Something isn't working label Jan 19, 2022
@knadh
Copy link
Owner

knadh commented Jan 20, 2022

Ouch, this is a miss. Failed to foresee variables being passed to TrackLink. Will fix this shortly.

@knadh knadh closed this as completed in d2cf6e0 Jan 30, 2022
@knadh
Copy link
Owner

knadh commented Jan 30, 2022

<a href="{{ TrackLink .Subscriber.Attribs.jobs.link }}">View</a> works in d2cf6e0. This will be available in the upcoming release.

@HiteshPaliya
Copy link

Hi, I'm trying to get count of people who has clicked the {{ UnsubscribeURL }} in the campagin analytics!

I tried adding TrackLink at multiple places with the UnsubscribeURL template variable, but wasn't successful.

<a href="{{ UnsubscribeURL@TrackLink }}" style="color:black;">Unsubscribe</a>
<a href="{{ TrackLink {{ UnsubscribeURL }} }}" style="color:black;">Unsubscribe</a>
<a href="{{ TrackLink UnsubscribeURL }}" style="color:black;">Unsubscribe</a>
<a href="TrackLink {{ UnsubscribeURL }}" style="color:black;">Unsubscribe</a>
<a href="{{ UnsubscribeURL }}@TrackLink" style="color:black;">Unsubscribe</a>

The last one did showed the URL but @Tracklink text was appended to the end so it threw Invalid UUID(s) error when navigating to Unsubscribe page.

I just want to know how many users clicked on the Unsubscribe link in the footer.
So is there a better way to achieve this or am I doing something wrong?

Thanks

@knadh
Copy link
Owner

knadh commented Mar 1, 2022

{{ TrackLink (UnsubscribeURL .) }} <-- This will work. This isn't recommended because the unsubscribe link is unique for each user, so the UI will not show a total count, but one click per unique unsubscribe link per user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants