I need to solve the following problem. We are using the CTA button on LP. When the user clicks it, he is redirected to our target page. And I need to be able to add a dynamic parameter using JS code on the LP so that it will be added as a GET to the destination link (our target page) to which the user will be redirected after clicking on the CTA button.
Can someone write step by step on how to add a dynamic parameter to the link a user will be taken to when they click on the CTA?
Due to the way HubSpot CTAs function it'd make more sense to create a custom module instead. You wouldn't even need Javascript to add the dynamic parameter then. If you still need HubSpot tracking on the button there's custom events and tracking URLs.
Just create a module and then the following set up should get you custom button with a dynamic parameter:
You'll just need to change '?parameter=' ~ site_settings.company_name with whatever parameter name and variable you're wanting to use. Also add some CSS to style the button.
If this answer solved your question, please mark it as the solution.
Due to the way HubSpot CTAs function it'd make more sense to create a custom module instead. You wouldn't even need Javascript to add the dynamic parameter then. If you still need HubSpot tracking on the button there's custom events and tracking URLs.
Just create a module and then the following set up should get you custom button with a dynamic parameter:
You'll just need to change '?parameter=' ~ site_settings.company_name with whatever parameter name and variable you're wanting to use. Also add some CSS to style the button.
If this answer solved your question, please mark it as the solution.