CMS Development

AYadav
Miembro

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 Me gusta
2 Respuestas 2
tjoyce
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

Store utm_source in a variable

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

dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Store utm_source in a variable

@tjoyce ,

I feel like you might be able to help here

0 Me gusta