# Set subscription type value with Contact Form7

**URL:** <https://community.hubspot.com/t/set-subscription-type-value-with-contact-form7/81945>\
**Category:** Lead Capture Tools\
**Tags:** professional\
**Created:** [May 24, 2023, 4:40pm UTC](https://community.hubspot.com/t/set-subscription-type-value-with-contact-form7/81945 "2023-05-24T16:40:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ANagy7](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@ANagy7](https://community.hubspot.com/u/ANagy7)\
**Post date:** [May 24, 2023, 4:40pm UTC](https://community.hubspot.com/t/set-subscription-type-value-with-contact-form7/81945/1 "2023-05-24T16:40:37Z")

</div>

Hello,

I use HubSpot with ContactForm7 plugin and I mapped my forms with the corresponding forms created in HubSpot. The only thing is that I cannot manage a value - I want to set it to “Subscribed” - to a subscription type.

I wouldn’t use a separate checkbox when sb contacts me, he/she wants a reply.

Any idea?

Thanks,

András

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [May 25, 2023, 9:25am UTC](https://community.hubspot.com/t/set-subscription-type-value-with-contact-form7/81945/2 "2023-05-25T09:25:30Z")

</div>

Hello @ANagy7  
In Contact Form 7, add a hidden field to your form by inserting the following code into your form’s HTML code:

```lia-code-sample
<input type="hidden" name="subscription_type" value="Subscribed" />

```

This will create a hidden field named “subscription\_type” with the value set to “Subscribed”.  
In the Contact Form 7 editor, find the “Additional Settings” section and add the following code:

```lia-code-sample
on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit', 'Subscribed');"

```

This code will trigger the event when the form is submitted successfully. when a user submits the Contact Form 7 form, the hidden field “subscription\_type” with the value “Subscribed” will be sent to HubSpot, and the corresponding contact property will be set to “Subscribed” for that contact.

---

<div class="post-metadata">

**Author:** ![ANagy7](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@ANagy7](https://community.hubspot.com/u/ANagy7)\
**Post date:** [May 26, 2023, 8:32am UTC](https://community.hubspot.com/t/set-subscription-type-value-with-contact-form7/81945/3 "2023-05-26T08:32:50Z")

</div>

Hi Himanshu,

sounds good, thank you very much!

I will try.

My current workaround is that I set a required acceptance field checked by default.

Best,  
András
