Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Incorrect Clickthrough URL #243

Open
bitblip opened this issue Nov 27, 2017 · 4 comments
Open

Incorrect Clickthrough URL #243

bitblip opened this issue Nov 27, 2017 · 4 comments

Comments

@bitblip
Copy link

bitblip commented Nov 27, 2017

Hi

I'm running into problems with the wrapLink function. I'm running MFG on windows and I wonder if the new line character may be in play?

Following the setup tutorial, this simple template

Hi {{email}}

{test/http://www.google.com}

This produces some unexpected merge html. You can see the html has gotten into the url value and the link text contains part of the {{email}} expression.

<div>Hi <a href="http://localtest.me:8080/clickthrough?url=div><div><br></div><div>{test/http://www.google.com&trackingId=example-tracking-id">{email}}<</a></div>

Examining the wrapLink function in analytics.js, I wonder if replace /{(.+?)/(.+?)}/g is a bit naive? A simple template as follows incorrectly matches the handlebars expression as part of the tracking link.

{{name}} {test/test}

@AlexVipond
Copy link

@JoshuaSlaven42 I'm having this issue as well, I can't use any templates that insert fields and track links.

However, @QuincyLarson does it successfully in this video: https://www.youtube.com/watch?v=_7U03GVD4a8

So I'm not quite sure what the root cause is

@bitblip
Copy link
Author

bitblip commented Mar 12, 2018

@AlexVipond It's my understanding of the regex expression used by mail-for-good as of issue creation that the line break you see in the video is what enables using both fields and links in the same message.

Have you tried breaking field and link tracking apart into separate lines?

@AlexVipond
Copy link

@JoshuaSlaven42 Yes, my original message was something like

Dear {{firstName}},

Blah blah blah

Blahblahblah blah {trackingExample/https://www.example.com}. Blah blah.

Sincerely,
Me

Typed directly into the WSIWYG editor, as seen in the video. I haven't tried it in plain text yet, or forcing line breaks with <br>

@goehlemichael
Copy link

goehlemichael commented Mar 10, 2019

If I follow the format:
{trackingExample/https://www.example.com}

It displays on my email like this:
https://www.example.com&trackingId=079e9541-5d24-5340-a374-1aae6f66a9f5">trackingExample

Instead of actually displaying a link. This is following the instructions given in the template creation page

Has anyone else gotten this to work properly?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants