Utilizing the same Form API on different pages


I am submitting on behalf of a customer:

The team is utilizing the a Form API to pass form data over to HubSpot. However, they are now utilizing the same form on different pages, but the pageUrl parameter seems to be using the old page even though the submission came in from the new page.

The customer will like to know what is the best practice to handle such situation:

  1. How to better make the pageUrl parameter dynamic so that it takes on the actual Page URL?
  2. Or is it better to create separate Form API for each page?

Thanks team for the help!


Providing an update about an offline conversation I have had with Derek:

It sounds like the pageUrl field has been hard-coded into the form somehow. The pageUrl field is a part of the hs_context field, and it's usually populated server side by checking the referrer header of the request.

If more details can be shared on how exactly the 'pageURL' information are collected, the team can help to take a closer look.