Skip to content
FunnelGuard

Fix guide by FunnelsGuard

HubSpot form submission not attributed to the page: fix it

DLV-078Medium impactCould addBy FunnelGuardPublished Updated
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.

Where page attribution is lost
  1. Visitor lands on pageReads the service page
  2. Form is submittedTracking code missing or form in iframe
  3. Contact createdPage URL blank or wrong
  4. 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

Check a real submission
  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Common causes and what you see
CauseWhat you see in HubSpot
Tracking code missing on the pagePage URL blank, contact has no page views
Form in a third-party iframePage URL is the iframe address, not your page
Raw HTML form posting to the Forms API without page fieldsPage URL blank unless you send pageUri
Cookie banner blocks HubSpot until consentSome submissions have no page or tracking cookie
Form submitted on a pop-up from another domainWrong domain shown as the page

How to fix it

Fix page attribution
  1. 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.

  2. 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.

  3. 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).

  4. 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.

  5. 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.

Install the tracking code by platform
  1. 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.

  2. Embed forms with the plugin block

    Use the HubSpot form block rather than pasting an iframe.

Forms API submission with page contextjavascript
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
    }
  })
});
Form submission record

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

Confirmation checklist
  • 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

Prevention
  • 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.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.