I am looking for some help on sending cookies and Ip Addresses to a custom Form submission with Javascript. I am getting teh two warnings on the submission. I am having no problem sending all of the data with a custom form ( I am using my own markup as well, so not using the form embed). If I swapped to a form embed and styled out that way would the cookies and IP address be sent with relevant matching form fields?
Yes, if you switch to using HubSpot’s embedded form, it will automatically capture and send the visitor’s cookies and IP address without any extra effort on your part.
HubSpot’s built-in forms come with tracking capabilities that capture user data like cookies, IP addresses, and more.
For custom forms,
If you’re sticking with your own markup and need to capture these details, you’ll need to do a few things.
1. Use window._hsq to get the user’s HubSpot tracking cookie (known as hubspotutk). const hubspotCookie = document.cookie.split('; ').find(row => row.startsWith('hubspotutk')).split('=')[1];
3. Include hubspotutk and ipAddress as hidden fields in your form submission payload, e.g., hubspotutk: hubspotCookie and ip: ipAddress.
4. Use the HubSpot Forms Submission API to submit the form, including the cookie and IP data.
Recommendation: If possible, switching to the HubSpot embedded form will make things easier, as it’ll handle all tracking automatically and ensure the data is accurate and synced properly. You can still customize the styles using CSS to make it match your design.
Yes, if you switch to using HubSpot’s embedded form, it will automatically capture and send the visitor’s cookies and IP address without any extra effort on your part.
HubSpot’s built-in forms come with tracking capabilities that capture user data like cookies, IP addresses, and more.
For custom forms,
If you’re sticking with your own markup and need to capture these details, you’ll need to do a few things.
1. Use window._hsq to get the user’s HubSpot tracking cookie (known as hubspotutk). const hubspotCookie = document.cookie.split('; ').find(row => row.startsWith('hubspotutk')).split('=')[1];
3. Include hubspotutk and ipAddress as hidden fields in your form submission payload, e.g., hubspotutk: hubspotCookie and ip: ipAddress.
4. Use the HubSpot Forms Submission API to submit the form, including the cookie and IP data.
Recommendation: If possible, switching to the HubSpot embedded form will make things easier, as it’ll handle all tracking automatically and ensure the data is accurate and synced properly. You can still customize the styles using CSS to make it match your design.
Gotcha thanks so much for this response! This is very helpful and was what I was thinking. I am going to swap some of the forms to the embed and unfortunately will probably have to keep one of them as a custom form submit!