HubSpot ignores certain forms if they contain sensitive fields. For example, forms with any creditcard information will be ignored. If you check the source code of collectedform.js
you will see that they ignore forms with a type, name or value that contains “credit card”, “card number”, “expiration”, “expiry”, “ccv”, “cvc”, “cvv”, “secure code”, “mastercard”, “american express”, “amex”.
If I read the source code correctly, they also ignore forms that contain a password field, they check for the name, attribute and type as well.
So this form is not collected because it contains an input with the password type.
I think you can fix this by creating a 2 step form, first collect the necessary details and use another form to set the password.
Another option is to use the API to collect form submissions instead.
So it might be the way the first form is send, or something in your form is blocking the form to be collected by HubSpot.
We have an woocommerce form as well, and we use a custom PHP script to send the form submissions to HubSpot instead. That could be your solution if you are up for some custom work.
@BWhittle
It is an older script, the API has changed since we created it, but it still works.
class HubspotAPI {
// Function to send lead to Hubspot
public function sendLead($post) {
// Default settings
$baseURL = 'https://forms.hubspot.com/uploads/form/v2/';
// Portal ID of client
$portalId = 'xxxxx';
// Hubspot Form ID (grabbed from URL)
$hubspot_form = '';
if (isset($post['hubspot_form'])) {
$hubspot_form = $post['hubspot_form'];
} else {
return 'No endpoint set!';
}
// if (!isset($post['email'])) {
// return 'Important information is missing';
// }
$params = '';
// Loop through all post values and build URL params, example: FirstName=Teun&LastName=Rutten
foreach($post as $key => $value) {
if ( ! empty( $value ) ) {
$name = $key;
$params = $params . $name . '=' . urlencode($value) . "&";
}
}
$hubspotutk = isset($_COOKIE['hubspotutk']) ? $_COOKIE['hubspotutk'] : ''; //grab the cookie from the visitors browser.
$ip_addr = $_SERVER['REMOTE_ADDR']; //IP address too.
$hs_context = array(
'hutk' => $hubspotutk,
'ipAddress' => $ip_addr,
'pageUrl' => $post['url'],
'pageName' => isset($post['page']) ? $post['page'] : ''
);
$hs_context_json = json_encode($hs_context);
$params = $params . '&hs_context=' . urlencode($hs_context_json);
// Prepare URL
$endpoint = $baseURL . $portalId . '/' . $hubspot_form;
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/x-www-form-urlencoded'
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch); //Log the response from HubSpot as needed.
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //Log the response status code
curl_close($ch);
return $response . ' ' . $status_code;
}
}
We created the above class, which can be called in the PHP file where you are sending your form:
$sendHubspot = new HubspotAPI();
$sendHubspot->sendLead($_POST);
You have to pass it the URL, page name and the ‘hubspot_form’ (Form ID) through the post object, which could be achieved by setting those as hidden fields, are setting it through the code.
Important note, if the name of your input of your form matches a HubSpot contact property, the value will be stored on the contact