How to parse URL parameters utm_... to generate a json structure with all the utm_

Hello Makers!

I need your input about how to parse a string representing an URL and generate a json structure with all the parameters from the string.

Example : input is the following string representing the URL “https: // mywebsite.com /?utm_source=google&utm_medium=cpc”

That would generate at the end of the scenario a JSON structure with:
{"utm_source": "google","utm_medium": "cpc"}

utm_* could be any of utm_source,utm_campaign, utm_id, utm_term, utm_content or even others not in this list (to create other utm_ that would convey other informations).

Thanks,
Laurent