Brendan Schwartz, CTO of Wistia, writing on their company blog on how it works:
Here‘s how it works. Fresh URL detects which analytics providers you‘re using and sets up watches on them to see when they‘re ready. Once Fresh URL confirms that each provider has extracted the information it needs from the URL, it calls replaceState to remove the UTM codes.
Nice of them to release it as open source. Kudos Wistia.