Link Block - URL params

Is custom code the only way to pass dynamic URL params (e.g., the page name) on a button click?

I have a website where all the buttons are Link Blocks, and I don’t really want to go through all of them and replace them with custom code…but as far as I can tell, there’s no way of passing a dynamic param through the Link Block settings

Depends on what you mean by dynamic param, but if e.g. you’re doing some kind of affiliate tracking or CRO tracking then yes Javascript will be the easiest way to append the querystring to those links.

We have a booking page. I want to track how customers reach this page from other pages on our site.

To do this, was thinking I could just append a ‘page’ param, and then I can pretty easily track how customers reach my booking page.

For example, on ‘Blog article 1’ the link to the booking page becomes www.examplewebsite.com/book-an-appointment?page=blogarticle1, on ‘Blog article 2’ the URL becomes www.examplewebsite.com/book-an-appointment?page=blogarticle2 etc. - and then it is pretty easy for me to seen how customers are reaching the booking page.

I can’t hardcode these links, because I’m using shared components across lots of pages.

If it’s from your own site, the easiest way is a site-wide JS that tracks the last page visited in sessionStorage. Then when someone hits the booking page you know where they came from.