Non-HubSpot forms are not captured when they are submitted via Ajax.
Feb 18, 2021 1:59 PM - edited Feb 18, 2021 2:01 PM
Our drupal website has a non-Hubspot form that sends form data with Ajax. Other non-HubSpot forms without Ajax are captured successfully by the HubSpot tracking code but the Ajax one is not. Is there any way to have the HubSpot code detect/capture the AJAX form submission and send the form data to our Hubspot account? Our intention here is not to write custom codes to send form data with Ajax using a POST request, rather to have all the non-HubSpot forms, including ajax and non-ajax ones, auto-captured upon submission by the HubSpot code.
Our website system environment:
- HubSpot tracking code is integrated into the website with a google tag manager (by drupal GTM module).
- HubSpot cookie compliance banner is enabled on the website.
- Powered on Drupal 8. The ajax form is built with drupal webform module with an Ajax option enabled. If I disable the ajax, it works. But when I enable it again, doesn't work.
I looked at this knowledge-base page (https://knowledge.hubspot.com/forms/use-non-hubspot-forms) and tried everything I can, but still cannot get it working.