Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Pass HSContent cookie value to hidden form field
Member
Sep 16, 2019 8:02 PM
Hi guys, long story short
Im creating a survey with a custom form and I develop with CUSTOM MODULE in hubspot. I finished the form with the opening like this:
<form id="msform" action="https://forms.hubspot.com/uploads/form/v2/5435007/bb741987-d401-482b-86b3-13ebf0405ec4" method="post">
but when I tried to submit, it said my IP address cookie was not being passed so I have to add a hidden field :
<input type="hidden" id="something" name="hs_context" value="">
I follow this documentation:
https://developers.hubspot.com/docs/methods/forms/submit_form
and what I needed to do is pulling the cookie from this REQUEST BODY with the example like this:
hs_context=%7B%22hutk%22%3A%2260c2ccdfe4892f0fa0593940b12c11aa%22%2C%22ipAddress%22%3A%22192.168.1.12%22%2C%22pageUrl%22%3A%22http%3A%2F%2Fdemo.hubapi.com%2Fcontact%2F%22%2C%22pageName%22%3A%22Contact%2BUs%22%2C%22redirectUrl%22%3A%22http%3A%2F%2Fdemo.hubapi.com%2Fthank-you%2F%22%7D
Im gonna use javascript to do this task, can someone help me with a full functional code to help me achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content