CMS Development

GPyb
Membro

Dynamic parameter in CTA button

resolver

Hi,

 

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?

 

 

0 Avaliação positiva
1 Solução aceita
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Dynamic parameter in CTA button

resolver

@GPyb 

 

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:

 

hubspot-custom-button-module.png

 

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.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

Exibir solução no post original

3 Respostas 3
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Dynamic parameter in CTA button

resolver

@GPyb 

 

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:

 

hubspot-custom-button-module.png

 

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.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
MWallace58
Participante

Dynamic parameter in CTA button

resolver

Hey Alyssa! 

Thank you for sharing this solution. I am curious could this approach also work for inseting a dynamic button into a hubspot automated email too?

0 Avaliação positiva
alyssamwilie
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Dynamic parameter in CTA button

resolver

Yes, this should work on automated emails as well.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
0 Avaliação positiva