Pure function, no plugin dependency, so it is fully unit tested. Keeps Play's
organic referrer rather than discarding it -- that is how paid and organic
installs get told apart.
Lets FormatException escape on malformed encoding so the caller can record it
rather than silently losing an install.