SOLVED

Marketo UTMs' "amp;" issue

Go to solution
Roy_Grossman
Level 1

Hi,

I'm working on few emails and came across a weird issue-

When copy-pasting a UTM into marketo, it adds "amp;" to the UTM.

For example, the following UTM:

www.google.co.il?&utm_source=marketo&utm_medium=email&utm_campaign=test

Will be converted into this one:

www.google.co.il?&utm_source=marketo&utm_medium=email&utm_campaign=test

I tried using the "HTML source editor" and the "insert/edit link" button, both didn't work.

Can you please tell how/if it affects the UTM?

Thanks,

Roy

Tags (1)
1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

It's not an "issue" — there would be an issue if links weren't built this way!

In HTML, the ampersand (&) character has special meaning: it's the character at the beginning of a character reference. You've seen such references as © or ‍ in the past, I'm sure.

In order to avoid breaking links, whenever you want a a literal & — that is, where you aren't using it to start off a special character reference — you must use its own character reference, which is &. This means that what you think of as a run-of-the-mill URL like

https://www.example.com/?utm_medium=email&utm_campaign=myCompaign‍‍‍

when it appears in the href of an <a> tag, should be written:

<a href="https://www.example.com/?utm_medium=email&amp;utm_campaign=myCompaign">Click here</a>‍‍‍

Note that the URL as sent by the browser doesn't have the &amp; in it. The &amp; is necessary only within HTML, to make sure the link is rendered unambiguously. Again, you'd never type &amp; in the browser bar, it has no special meaning there and you'd mess things up in the other direction!

You're probably thinking. "But I don't think my links have ever been broken...."  True, you might've gotten lucky so far. But to give you an idea of how a link can be broken without &amp; imagine you're trying to get people to the URL:

https://www.example.com/?audience=global&euro;germany;berlin ‍‍‍‍‍

If you put that in an href as-is:

<a href="https://www.example.com/?audience=global&euro;germany;berlin">test render</a>‍‍‍

The link will be broken, because you've accidentally included a character reference: &euro; is the character ref for the Euro symbol! So people will end up on the wrong page (probably a 404):

pastedImage_2.png

The correct way to link to that URL in HTML is indeed:

<a href="https://www.example.com/?audience=global&amp;euro;germany;berlin">test render</a>‍‍‍

View solution in original post

11 REPLIES 11