I’m using Hubspot’s forms with hidden utm fields (utm_source,utm_campaign etc).
The forms are embedded in a 3rd party landing pages app (Webflow) and not using the landing pages of hubspot.
Here is the issue:
When someone clicks an ad on facebook, redirect to a page with utms in the url, decides not to submit a form and comes backa day after to our website. Allegdly, this it an organic lead, but due to the cookies, we can store the utms and push them to the hidden fields on form submission.
Hey @MPcomuunity querys strings in the URL will only populate if the query string is on the url at the time of form submission, it doesn’t permanently store them within the cookie to pull at a later date. Meaning if the visitor leaves the url with the query string and comes back to the regular url, these fields will not be populate in the form submission.
You would need some custom code to store the information on the browser and pull it at a later date, I haven’t seen this before but I believe it may be possible with Javascript (you’ll need some javascript skills to do this then).
If it is source tracking you’re looking to do however, the HubSpot cookie should automatically take care of this, as long as a HubSpot cookie is dropped, even without a form submission, it will log the source data to the cookie. When a form is eventually submit on that cookied browser it will automatically populate the original source fields with the information on the source of the contact. Is this not working as expected for you?
Lets assume your were redirected (with utms in the URL) to the main page. Then, you decide to move to another page (book a demo page), and thus the url is naked and doesn’t contain the utms.
On submission, the only thing you’ll have is the first referring site property with those fields. from there, I can extract the utms using JS.
But, think of a scenario that a lead lands on main page with URL from FB, than comes back after the session ends like 15 days after for instance. than the utms a re long gone.
In this case we have a js running at the backend that keeps the utms for 30 days. but due to the use of webflow (and not hs pages) and since we are not using the forms with the rae HTML design, we can’t push this data.
I’d like to have you feedback on that if possible.
If a visitor comes to a HS tracked web page, it will drop a cookie on that browser to track that visitor over that domain. If they come back 15 days later, to the same domain and submit a form, the CRM will automatically associate that cookie with the contact and include it’s original visitor information to the original source fields. Even if the form was submit long after the original cookie was dropped.
Realistically what happens is like this:
First visit = Cookie dropped with referral source info.
Other page views = Logged to cookie.
Disenagement = nothing
re-visit = Same cookie (if still on the browser) logs page views.
Form submission = Sends field data to HubSpot, creates or updates a contact record and associates that cookie with a contact record.
Think of the forms as quite “dumb”. It literally just sees a query string matching a field value and populates it. If a visitor visits a page with a form that doesn’t have the query string, forms don’t actively look for previously visited query string pages to populate data. I’m sure it’s possible to pull this data from the cookie but that would require some custom code.
Even with raw HTML forms, you’ll need to take the data out of a storage space and pass it to a form. If you’re already storing it somewhere, it might be worth looking into customising the form embed code to pass this info to the form fields.
I’m aware to the original fields, though there are many inconcictancies there and it reqiuers lots of fixes and monitoring. Unfortunatley, the lack of flexibility of Hubspot (like in many other cases) prevents it from taking place directly from the website, where the JS can do a much better job than the auto solution provided by HS.
Yeah this is a common issue with HubSpot forms. The native UTM tracking only captures UTM parameters if the user completes the form on the exact same page they initially land on. If they browse around your site (or in your case, leave and come back later), the UTMs are lost and won’t be captured.
There are dedicated tools that can solve this for you though. Tools like Attributer.io capture the UTM parameters when someone first lands on your site, store them in a first-party cookie, and then automatically write them into HubSpot’s hidden fields when the form is submitted (even if it’s days later and through the styled embed approach you’re using). We have a number of customers using it with HubSpot Forms on Webflow (I am the founder of Attributer).
Plus, tools like this also capture attribution data for visitors who don’t have UTM parameters (like Organic Search, Organic Social, Direct Traffic, etc.), and they can capture click IDs like GCLID and FBCLID which are useful for conversion tracking.
You could try to build a custom solution using localStorage and HubSpot’s Forms API, but maintaining that across HubSpot updates and different browsers gets quite complex compared to using a tool designed specifically for this problem.
Quick note: I used AI assistance to help structure this response because I’m not the best writer, but the technical advice comes from my experience and I’ve reviewed it before posting.