S.R.
S.R.

Reputation: 11

How to prevent Nationbuilder email from breaking links with query parameters?

We use Nationbuilder for our website and discovered that when Nationbuilder encodes links (for tracking), it will break them if they contain multiple query parameters.

For instance, say we insert the following link in an email in Nationbuilder:

<a href="http://www.example.com/?a=1&b=2">click me</a>

Assuming our Nationbuilder website is hosted at www.website.org, then Nationbuilder will rewrite the link as such:

<a href="http://www.website.org/r?u=http%3A%2F%2Fwww.example.com%3Fa%3D1&b=2&e=986513203a6d0d0a90fd5ab67500a9a5&utm_source=my_source&utm_medium=my_medium&utm_campaign=my_campaign&n=2">click me</a>

When one clicks the link above, Nationbuilder processes it and records the click event in their system, but then incorrectly redirects to http://www.example.com?a=1 and discards &b=2.

Most people will immediately identify the problem -- our original url, passed as the "u" query parameter above, was not properly encoded by Nationbuilder. At the very least the ampersand before "b" should have been encoded, if not the equal signs as well, so that our entire original url would be captured in the "u" parameter. The correct link created by Nationbuilder, with the proper encoding, should have been this:

<a href="http://www.website.org/r?u=http%3A%2F%2Fwww.example.com%3Fa%3D1%26b%3D2&e=986513203a6d0d0a90fd5ab67500a9a5&utm_source=my_source&utm_medium=my_medium&utm_campaign=my_campaign&n=2">click me</a>

Shockingly, Nationbuilder tech support and their engineers say this behavior is "working as expected". We pointed out that no one would expect a working link to become a broken link, but they refuse to treat is as a bug or at least as a design error.

Does anyone have a suggestion for how we can get around this Nationbuilder "feature" of breaking links with query parameters? We use query parameters extensively in our URLs. We were thinking of shortening every link through bit.ly so they would have no query parameters but that seems like a lot of unnecessary work.

Thanks!

Upvotes: 1

Views: 367

Answers (2)

scottsanders
scottsanders

Reputation: 388

If none of the provided solutions work, you could use a URL shortening service such as bit.ly, and link to those shortened URLs from your NB email blast, which will then redirect to your full URLs as provided to the shortening service.

Upvotes: 0

Ryan Morgan
Ryan Morgan

Reputation: 1

Yeah, simply take your link with a parameter, and encode it, using a tool like this, http://meyerweb.com/eric/tools/dencoder/ so your URLs are not broken by NB's processing.

so

example.com/page?a=1&b=2

becomes

example.com%2Fpage%3Fa%3D1%26b%3D2

Upvotes: 0

Related Questions