On this page
What this issue is
Every HubSpot form submission can record the page it was sent from: the page URL and page title. HubSpot reads these from the visitor's browser when the form is submitted. If it cannot, the submission still creates a contact, but the Page URL is empty, shows an unexpected address, or points at a wrapper page instead of the landing page.
Why it costs you leads or sales
You do not lose the lead, but you lose the ability to learn from it. Without page attribution you cannot see which landing pages, blog posts or service pages generate enquiries. Reports like submissions by page become unreliable, so budget and content decisions are made on guesses. Sales also lose context: they cannot see what the person was reading when they enquired.
- Visitor lands on pageReads the service page
- Form is submittedTracking code missing or form in iframe
- Contact createdPage URL blank or wrong
- Reports by pageCannot show what converted
The lead still arrives, but the page it came from is lost.
How to check if your site has it
Open the form's submissions
In HubSpot go to Marketing > Lead Capture > Forms, open the form and select the Submissions tab. Look at the page column for recent entries.
Open a contact timeline
Open a recent contact and find the Form submission activity. Expand it and check that a page URL is shown and is the page you expect.
Submit a test yourself
Fill in the form on the live page with a test email. Then find that contact in HubSpot and see whether the page is recorded.
Check the tracking code is loaded
Open the page, press F12, go to the Network tab and filter for hs-scripts or hubspot. If nothing loads from js.hs-scripts.com, the tracking code is missing on that page.
Look for iframes or raw forms
Right-click the form and choose Inspect. If it sits inside an iframe, or is a plain form element posting to HubSpot by other means, page data may be lost.
| Cause | What you see in HubSpot |
|---|---|
| Tracking code missing on the page | Page URL blank, contact has no page views |
| Form in a third-party iframe | Page URL is the iframe address, not your page |
| Raw HTML form posting to the Forms API without page fields | Page URL blank unless you send pageUri |
| Cookie banner blocks HubSpot until consent | Some submissions have no page or tracking cookie |
| Form submitted on a pop-up from another domain | Wrong domain shown as the page |
How to fix it
Install the HubSpot tracking code everywhere
Get the code from Settings > Tracking & Analytics > Tracking Code. It must load on every page that has a form, including landing pages and thank-you pages.
Use HubSpot's own embed code
Copy the embed script from the form's Share tab instead of using an iframe or a copied HTML form. The script reads the real page URL.
If you post to the Forms API, send the page
Include pageUri and pageName in the context object of the request (see the code below).
Handle consent correctly
If your cookie banner holds HubSpot back, configure it through HubSpot's cookie banner settings or your consent tool so the script loads once consent is given. Do not remove consent controls.
Remove wrapper pages
If the form sits in a pop-up or framed page on another domain, move it onto your own page or embed the script directly.
Use the HubSpot plugin
Install the official HubSpot plugin, connect your account and it adds the tracking code to all pages. Avoid also pasting the code manually, which duplicates it.
Embed forms with the plugin block
Use the HubSpot form block rather than pasting an iframe.
Add the code to the theme
In Online Store > Themes > Edit code, paste the tracking script into theme.liquid before the closing head tag, or use the HubSpot app from the Shopify App Store.
Create a Custom HTML tag
Paste the HubSpot tracking script, set the trigger to All Pages (or after consent if you use consent mode), then publish the container.
Avoid double loading
Make sure the script is not also hardcoded in the theme.
Add to project settings
In Site settings > Custom code, paste the tracking script in Head code and publish. Use the HubSpot embed code in an Embed element for forms.
Add custom code
In Settings > Custom code, add the HubSpot script to All pages in the Head. Embed forms with an Embed HTML element using HubSpot's script.
Use code injection
In Settings > Developer Tools > Code Injection, paste the script in the Header. Use a Code block for the form embed.
Add the script to your template
Place the script in the shared head or footer so every page gets it, and send pageUri if you use the API.
fetch('https://api.hsforms.com/submissions/v3/integration/submit/PORTAL_ID/FORM_GUID', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
fields: [
{ name: 'email', value: 'test@example.com' }
],
context: {
hutk: document.cookie.replace(/(?:(?:^|.*;\s*)hubspotutk\s*\=\s*([^;]*).*$)|^.*$/, '$1'),
pageUri: window.location.href,
pageName: document.title
}
})
});Before
- Form in an iframe or raw HTML
- Page URL blank or shows the wrong address
- No page views on the contact
After
- HubSpot embed script and tracking code on the page
- Page URL shows the real landing page
- Page views and submission linked on the timeline
How to confirm it's fixed
- Submit the form on the live page with a test email
- Open the new contact and expand the Form submission activity
- Confirm the page URL is the page you submitted from
- Check the Submissions tab on the form shows the page too
- Repeat on a second page and in a private window
- Test again after accepting and after declining cookies, and note any difference
How to prevent it happening again
- Put the tracking code in one shared place, not page by page
- Always copy form embeds from HubSpot, never rebuild them as plain HTML
- Retest one form after theme, builder or consent tool changes
- Review the Submissions tab monthly for blank page values
- Document where the code is installed so redesigns do not drop it
How FunnelGuard handles this
FunnelGuard does not check this yet. Whether HubSpot recorded the right page on a contact is a possible future check, not something it does today.
What FunnelGuard does catch nearby: it runs your real lead form journey on a schedule from the EU or the US, checks each step, checks the tracking hits sent to ad and analytics platforms, and checks whether test leads reach the inbox and CRM. If the form breaks or the lead never arrives, you get one alert with a screenshot and a likely cause. That covers a broken form, not a missing page URL on the HubSpot record.
To watch for this yourself, create a saved view or list in HubSpot of recent contacts where the form submission page URL is unknown, and review it weekly. Also submit a test lead after every site change and inspect the timeline. A free FunnelGuard plan covers 1 site and 2 journeys with daily checks if you want the form journey itself monitored.
Questions people ask
Why is my HubSpot form submission not showing a page URL?
HubSpot probably could not read the page when the form was sent. Common causes are a missing tracking code, a form inside an iframe, a raw HTML form posting to the API without pageUri, or cookies blocked before consent. Check the Form submission activity on a contact to see which applies.
How do I see which page a HubSpot form was submitted on?
Open the form under Marketing > Lead Capture > Forms and view the Submissions tab, or open a contact and expand the Form submission activity on the timeline. Both show the page URL when HubSpot recorded it.
Why does HubSpot show the wrong page for a form submission?
This happens when the form lives on a different page or domain than the one visitors saw, such as an iframe, a pop-up host page or a wrapper. HubSpot records the address of the page that actually contains the form. Embed the form directly on your own page.
Do I need the HubSpot tracking code for form page attribution?
Yes, in practice. The tracking code sets the hubspotutk cookie and records page views, which lets HubSpot link a submission to a visitor and page. Install it on every page with a form.
Can I fix page attribution on old HubSpot contacts?
Not automatically. HubSpot does not backfill the page for submissions already stored without it. You can fix the setup for new leads and, if needed, update old records by import using data from another source.
How do I send the page URL when using the HubSpot Forms API?
Add pageUri and pageName to the context object of your submission request, along with the hutk cookie value. That tells HubSpot which page the form was submitted from.
Does FunnelGuard check HubSpot page attribution?
No, not yet. FunnelGuard checks that your form journey works and that test leads reach the inbox and CRM, but it does not currently verify the page URL on a HubSpot record.
Related issues
- DLV-077HubSpot contact created without UTM / original sourceFix guide
- DLV-076Contact not created in the CRM after submitFix guide
- DLV-096gclid/fbclid not stored on the CRM record for offline conversionsFix guide
- DLV-091Duplicate contacts created on every submissionFix guide
- DLV-088Fields unmapped: phone lands in notes or nowhereFix guide
- DLV-097Consent/marketing opt-in field not passed to the CRMFix guide