We have a non-HubSpot form where.Initially, form submissions were collected under a name created from Tailwind CSS classes (e.g., "w-full, grid").We renamed the form to be more meaningful (e.g., "contactForm.Now new submissions are appearing under "contactForm234234341" (with random numbers).We need all submissions - both old and new - to appear under one meaningful form name
Need solution to consolidate submissions under a single, meaningful form name.
This is something I have wondered about myself because I have a WordPress site with active campaign forms embedded. The form ID is dynamic and so I have a ton of unique forms in my HubSpot account. I noticed if you remove the ID and CSS and set a new ID you can have more control over how it is named.
So you would need to write some javascript to clear the dynamic ID and set a new ID that stays static on each payload. This works but you need to test to make sure your form still works with the ID change. If so, you should be good but if not I don't see a way around this except using the HubSpot API to submit form submissions instead of the default tracking script.
document.addEventListener("DOMContentLoaded", function () {
var form = document.querySelector("form"); // Adjust selector if needed
if (form) {
// Remove existing form ID
form.removeAttribute("id");
// Remove all existing classes
form.className = "";
// Get the page slug (last part of the URL path)
var pageSlug = window.location.pathname.split("/").filter(Boolean).pop() || "home";
// Set new form ID
var newFormId = "contactForm_" + pageSlug;
form.setAttribute("id", newFormId);
}
});
This is something I have wondered about myself because I have a WordPress site with active campaign forms embedded. The form ID is dynamic and so I have a ton of unique forms in my HubSpot account. I noticed if you remove the ID and CSS and set a new ID you can have more control over how it is named.
So you would need to write some javascript to clear the dynamic ID and set a new ID that stays static on each payload. This works but you need to test to make sure your form still works with the ID change. If so, you should be good but if not I don't see a way around this except using the HubSpot API to submit form submissions instead of the default tracking script.
document.addEventListener("DOMContentLoaded", function () {
var form = document.querySelector("form"); // Adjust selector if needed
if (form) {
// Remove existing form ID
form.removeAttribute("id");
// Remove all existing classes
form.className = "";
// Get the page slug (last part of the URL path)
var pageSlug = window.location.pathname.split("/").filter(Boolean).pop() || "home";
// Set new form ID
var newFormId = "contactForm_" + pageSlug;
form.setAttribute("id", newFormId);
}
});
Hi, @MadhumithaR👋 Welcome to our community! Thanks for your post. I'd like to invite some of our community members to the converstaion — hey @BarryGrennan@TomM2@Jake_Lett, do you have any suggestions or other thoughts on this issue for @MadhumithaR?
Thank you very much for taking a look! — Jaycee
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !