How To: Add Dynamic URL Parameters to Your Links!

Hey guys!

I figured it out!


I asked this question two weeks ago: URL Parameter modifies button link?

Is it possible to have the URL of a button’s link change depending on a URL parameter?

For example:

Button link is: https://example.com/[variablehere]/checkoutpage

So if the URL of the page is mysite.com/salespage/?affiliate=john, then the button links to https://example.com/123/checkoutpage

But if the URL is mysite.com/salespage?affiliate=tommy, then the button links to https://example.com/150/checkoutpage

Is that at all possible with customization rules and such? Or even to pull the URL paramter into the button’s link, so mysite.com/salespage/?affiliate=john would have a button that links to https://example.com/john/checkoutpage ?

Hopefully, all this makes sense. Thanks!

And all I got was the standard, this is out of scope of the forum reply. BUT IT WASN’T! Because you can totally do this with Pro/Cornerstone!

Here’s how: simply make the URL of your button this:

https://baseurl.com/{{dc:url:param key="yourparameterhere"}}

And bada-bing, bada-boom, if there’s a yourparameterhere in your URL, that value shows up in the button link!

Hello @aleminopuy,

Thanks for writing to us.

Glad to know that you were able to get the proper solution for your requirement. Thanks for sharing the information. Please feel free to reach us if you have any queries regarding our theme and theme settings.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.