CMS Development

AYadav
Membre

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 Votes
2 Réponses
tjoyce
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Store utm_source in a variable

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

dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Store utm_source in a variable

@tjoyce ,

I feel like you might be able to help here

0 Votes