Changing button href link based on url parameters

I’m trying to create a button with a link (href) that will be modified based on url parameters.
To be precise I have this link:


And I need the “XXX” to changed based on the url parameter “?username=YYY” I’m passing to the landing page.

In addition I also need to create a fallback option if this parameter will be missing, so I’ll be able to send the user to the homepage or something.

This is the page in question: “ Drag & Drop Headless CMS