CMS Development

AYadav
Membro

Store utm_source in a variable

I want to store the utm_source in a variable which I am able to get in the hidden field in a form and append it to another links url

 

Form code
<script>
hbspt.forms.create({
region: "na1",
portalId: "id",
formId: "{{ module.hidden_form.form_id }}",
onFormReady: function($form, ctx){
var hv = $('.hs-utm_source input').attr("value");
console.log(hv);
}
});
</script>

 

It always gives me undefined

0 Avaliação positiva
2 Respostas 2
tjoyce
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Store utm_source in a variable

@AYadav - Can you link to the preview of the page?

dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Store utm_source in a variable

@tjoyce ,

I feel like you might be able to help here

0 Avaliação positiva