Join the Webstudio community

Updated 7 months ago

Get UTM parameters in the URL

At a glance
Hi folks!

I need to bind URL parameters on my page.

Exemple my URL : mywebstite.com/landing-page?firstname=John&lastname=Doe.

I have to add a title (h1) : "Welcome John Doe" where {firstname} and {lastname} are binded.

For me it already works with a script in an HTML embed.

But I need to understand if it could be a better alternative with a way to access to some parameters in URL like system.params.firstnameor other technic in Webstudio.

@John Siciliano maybe you have an idea?

Here is an example: https://airtable-job-board-cfkpo.wstd.io/landing-page?firstname=John&lastname=Doe

Thanks!
O
M
J
6 comments
I think the question is not clear. Specifically what you are doing now and what you want to improve about it.

You can always bind them as text and you can bind them as custom data attribute and then access by scripts
All right. I did the trick thanks to data-attributes. But in a video about Airtable, John is accessing to the slug thanks to {system.search.name}. Thanks to that I understand that you can access to the slug. But I don't know if you can access to the differentes parameters from the slug (ex. : https://airtable-job-board-cfkpo.wstd.io/landing-page?firstname=John&lastname=Doe => firstname and lastname).

I read the doc but I'm not sure I understand completly.

It just a question about best practices on Webstudio.
Attachment
SCR-20240621-mgfy.png
query params are available in system.search.yourparam wheras slus/url params are available in system.params.yourparam
this is called query parameter in standard URL terminology, its not a slug
?firstname=John&lastname=Doe
slug is part of the path /something/someslug/someotherslug
Hey guys! Sorry the first time I tried, it didn't work (I could not access to the queries params). I retest it and it work really fine! Thanks a lot! Have a good weekend!
Add a reply
Sign up and join the conversation on Discord