-
Notifications
You must be signed in to change notification settings - Fork 22
Flexmailer tries to apply tracking to anchor links, breaking them #43
Comments
facing same issue.. @totten any thought on how to fix this? |
@totten , So the result of clicking a tracked "#" link is that the user cannot move into anchors inside same email body page, is redirected to Civi, followed by a browser error page because of the redirection loop, and Civi tracks this click 20 times (in my tests with Firefox) I'll work on a PR to exclude anchor links from tracking. |
PR #51 submitted! |
#51 was closed because it treated both internal and external anchors the same. Internal anchors should be untracked, but external anchors should still be tracked. In the discussion of #51, I added some suggestions for an updated patch. |
Since flexmailer applies tracking to anything like href='foo' or href="bar", it converts anchor links (of the form href="#foo") to tracked links, which of course breaks those links.
See here:
https://github.com/civicrm/org.civicrm.flexmailer/blob/master/src/ClickTracker/HtmlClickTracker.php#L71
and here for text:
https://github.com/civicrm/org.civicrm.flexmailer/blob/master/src/ClickTracker/TextClickTracker.php#L59
A simple solution would be simply to ignore any link of the form href="#foo" or href='#bar'. Not much of a change, but would be helpful (this is an issue that a few people have noticed with Mosaico). Does this approach make sense?
The text was updated successfully, but these errors were encountered: