Tutorial

How Do You Tag Leads That Came From ChatGPT on a Webflow Form?

Written by
Pravin Kumar
Published on
Nov 6, 2026

How do you tag leads that came from ChatGPT on a Webflow form?

Add a hidden field to the form, then use a short script that reads the browser referrer when a visitor arrives. If the referrer is an AI assistant such as chatgpt.com or perplexity.ai, the script saves it and fills the field on submit. Your CRM then receives an AI source value on every lead, even when UTM tags are missing.

This tutorial is for one specific reader: a marketer or founder running a Webflow site with a demo or contact form that feeds HubSpot, either through a native integration or through Zapier or Make. You want to know which leads arrived from AI assistants, and your analytics tool alone is not giving you a clean answer.

The setup takes under an hour. It does not replace analytics. It adds one field to the lead record, which is where revenue questions actually get answered.

Why not just rely on UTM tags or analytics?

UTM tags only exist when the referring platform adds them, and that behavior can change without notice. Analytics tools report sessions, not leads, so connecting an AI visit to a closed deal is hard. A referrer field on the form puts the source on the lead record itself, where your CRM can report on it directly.

If your AI traffic numbers looked strange recently, you have already felt this problem. I wrote about one example in what happened to AI traffic reports when ChatGPT UTM tags dropped. When a source depends on someone else's tagging, your reporting depends on their choices.

The referrer is different. It is sent by the visitor's browser, not added by the platform. It is not perfect, and I will cover its limits below, but it gives you a second, independent signal that you control.

What do you need before you start?

You need edit access to the Webflow site, a plan that allows custom code, a form already connected to your CRM and a CRM property to receive the value. In HubSpot, create a single-line text contact property called something like AI Referrer before you touch Webflow. Naming it first keeps the mapping clean.

Check how your form reaches HubSpot. Some teams use the HubSpot form integration, some send Webflow form submissions through Zapier or Make, and some use a webhook. The method changes where you map the field, not how you capture it.

Finally, decide which assistants you care about. I start with chatgpt.com, perplexity.ai, gemini.google.com, claude.ai and copilot.microsoft.com. You can add more later. Write the list down now, because it goes into the script.

How do you add the hidden field in Webflow?

Inside the form block, add a normal text input and name it ai_referrer. Wrap it in a div block and set that div to display none, so visitors never see it. Give the input a clear field name, because that name is what your CRM integration will read. A regular input is more reliable than a custom embedded one.

Open the form in the Webflow Designer. Drag a div block inside the form, just above the submit button. Put a text field inside that div. In the field settings, set the name to ai_referrer and leave the placeholder empty.

Select the wrapping div and set its display to none. The field will still submit with the form, but nobody will see it. I use a regular input here rather than raw HTML in an embed, because integrations and form tools tend to pick up standard fields more consistently. Test that on your own setup either way.

Repeat this for every form you want to track. If your site has a demo form, a contact form and a newsletter form, each one needs the field.

What should the script do?

The script should check the referrer once per visit, compare its hostname to your list of AI assistants, and store the first match in the browser. On every page with a form, it should then fill the ai_referrer field with that stored value. First touch matters, because visitors often browse several pages before they submit.

In plain terms, the logic has three steps. When a page loads, read document.referrer and extract the hostname. If that hostname matches one of your assistant domains, and nothing is stored yet, save it in localStorage with today's date. Then look for any input named ai_referrer on the page and set its value to whatever is stored.

Add the script in your Webflow site settings, in the custom code area that loads before the closing body tag, so it runs on every page. Webflow's own documentation lists which plans include custom code. Keep it short and readable. Anyone on your team should be able to open it and understand what it does in a minute.

If you already capture UTM parameters, run this alongside that logic rather than replacing it. I covered the UTM side in how to capture first-touch UTMs in a Webflow form. Together, the two fields give you a much clearer picture than either one alone.

How do you map the field into HubSpot?

Map the Webflow field named ai_referrer to the HubSpot property you created. In a Zapier or Make flow, add it to the step that creates or updates the contact. With a native form integration, match the field in its mapping screen. Then submit a test lead and confirm the value appears on the contact record.

Decide how updates should work. I set the property to fill only if empty, so the first AI source a contact ever had is kept. If you want the latest source instead, use a second property. Mixing both into one field makes reporting confusing.

Once leads start flowing, build a simple HubSpot report: contacts by AI Referrer value, then deals by the same property. That second report is the one your founder or board actually cares about.

How do you test the setup?

Ask an assistant a question that leads to your site, click through to it, then submit the form with a test email. Check that the contact in HubSpot shows the right AI Referrer value. Then test a direct visit and a Google search visit to confirm those leave the field empty or labeled correctly.

Testing with a real assistant link matters. Typing your URL into the browser does not send a referrer, so it will not trigger the logic. Click from the assistant's answer.

Test on mobile too. If an assistant opens your site inside an app's own browser, the referrer may behave differently. Note what you see rather than assuming. A setup that works on desktop and fails quietly on mobile will undercount the source you care about.

What are the limits of referrer tracking?

Referrer data is useful but incomplete. Some apps and browsers send no referrer at all, privacy settings can strip it and modern browsers often send only the domain rather than the full page. Treat the AI Referrer field as a floor, not a total. It shows you leads you can confirm, not every lead an assistant influenced.

The domain-only behavior is not a problem here, because the domain is all you need to identify the assistant. Missing referrers are the real gap. A buyer who reads an AI answer, then types your name into Google a day later, will show up as search.

That is why I also add a free-text "how did you hear about us" question on high-intent forms. Self-reported source catches what the browser cannot. When the two fields disagree, the conversation about why is usually more useful than either number.

What should you do next?

Create the AI Referrer property in HubSpot, add the hidden field to your highest-intent Webflow form and install the script today. Test it with a real click from an assistant. Then let it run for a month and compare AI-sourced leads against your other channels on the deals report.

My view is that AI search measurement belongs on the lead record, not only in analytics dashboards. Once the source sits next to the deal, you can answer the question that matters, which is whether AI visibility is creating pipeline.

If you want help wiring source tracking from your Webflow forms into your CRM, or building the reports on top of it, reach out. I build websites and the automations behind them for lead generation, and this is one of the first things I set up. Let's chat.

Get found, cited and the back office automated

Let's make your site the source AI engines quote and wire up the systems behind it.

Contact

Let's get your website found and cited by AI

Tell me what you're working on, whether AI search is skipping your product, your back office is buried in manual work, or you need a build that does both.

Got it, thanks. I read every message personally and reply within 1-2 business days.
Oops! Something went wrong while submitting the form.