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 user KS on the Field Limits doc:

Does 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, which also is limited to 255.

This wouldn't be a problem, save for the fact that Marketo can't truncate longer URLs (including pathnames and query strings) to a guaranteed working URL.

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.)

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

But if your source could be a full Referrer URL, or a long URL from your product catalog, it's certainly possible to go over 255 characters.

Remember, in theory (per HTTP RFC) 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 will be < 100 chars, but there's a big gulf between 255 and the practical upper limit of 2000. 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. (When it comes to search engines, there can be all manner of mysterious tracking info, too.)

Even if Marketo abruptly truncates a long URL at the 256th character, the final value will (by definition of its 253-character limit) include the full domain name, and the URL will still be navigable.

But what will it navigate to? A 404 page? A blank search page because of invalid query params? Such are the concerns.

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).