Marketo field limits in the real world, Part II: *URL* is for domain names, not full URLs

If you haven't read it yet, check Part I (on Integers).

Continuing this series thanks to a prod from KS on the Field Limits doc: Does the URL field type have a character limit?

Indeed it does: 255 characters. And — unlike with Integer fields — this restriction is in sync with the SFDC field type of the same name, also limited to 255.

If you're only storing pre-parsed domain names, there's no problem with the max field length.

See, an implicitly-fully-qualified[1] domain name like www.example.com or pages.en.example.co.uknot including any leading or trailing URL components like https:// or the /path/name/and/?query=string — must indeed be under 255 characters. In fact, it must be under 253.

But when you store a full Referrer URL, a long URL from your product catalog, or anything else with a path and query string, it's certainly possible to go over 255 characters. Way over.

Remember, per the standard URLs have no max length at all.

In practice, URLs are best kept under ~2000 characters because some browsers (namely IE) struggle otherwise. The overwhelming majority of URLs are < 150 chars, to be sure, but there's not much breathing room between that and 255 -- and of course the URLs you're trying to save are the ones that matter, not URLs in general.

Search forms, including both search engines and in-site product searches, frequently generate long URLs, because they have a lot of info that's encoded in a GET. Add some friendly UTMs and the embiggening effects of percent-encoding and you can readily exceed 255.

In sum: if you're positive you're storing only domains, or if the input side is also limited to 255 characters, a URL field will work. Otherwise, use a Textarea. It may seem like overkill but it's the only way to be lossless.


Notes

[1] By which I mean the “full” domain names we typically use for public websites and email addresses. Technically, these don't contain an additional . at the end, so they aren't fully-qualified (although informally we may refer to them as FQDNs).