[SalesForce] Using RedirectTo() with an #anchor on the URL

SFMC automatically appends tracking information to our URLs at time of send. For example:

https://mywebsite.com

Becomes:

https://mywebsite.com?utm_campaign=xxx&utm_medium=email

Is it possible to append an anchor to the end of this URL to drop a user on a specific part of the page?

E.g. https://mywebsite.com?utm_campaign=xxx&utm_medium=email#page-anchor

It doesn't work for us to append the anchor on the base URL. Once tracking is appended after the pound (#) the anchor does not work.

Best Answer

This is definitely hacky, but it has worked for me in the past. You'll need to open a ticket with SFMC Support to request an update to your WAC string, so that the very last parameter name in your query string can be used your very last Additional Email Attribute. So if you already have and use 5 AdditionalEmailAttribute's, then this solution won't work.

Hypothetically let's say you already use 4, then the 5th would be added by SFMC support and could have a parameter name of "anchor". Then in your AdditionalEmailAttribute5 input in the email properties area, you can add your anchor, with the hashtag (#page-anchor in this example).

So your final url parameter would look like:

&anchor=%%__AdditionalEmailAttribute5%%

and would resolve to:

&anchor=#page-anchor

This needs to be at the very end of the WAC string and the very end of the url overall, or else it will not work. Be sure to test thoroughly by sending "live" emails to yourself (as opposed to test sends), so the WAC will be appended. This solution may not work in every case an anchor is needed, especially if there are extra redirects happening on the page you are linking to.

Related Topic