CMS Development

AYadav
メンバー

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 いいね!
2件の返信
tjoyce
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

Store utm_source in a variable

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

dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

Store utm_source in a variable

@tjoyce ,

I feel like you might be able to help here

0 いいね!