CMS Development

AYadav
Mitglied

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 Upvotes
2 Antworten
tjoyce
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Store utm_source in a variable

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

dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Store utm_source in a variable

@tjoyce ,

I feel like you might be able to help here

0 Upvotes