# HubSpot Tracking Code Scraping Squarespace Forms Incorrectly

**URL:** <https://community.hubspot.com/t/hubspot-tracking-code-scraping-squarespace-forms-incorrectly/30032>\
**Category:** HubSpot Ideas\
**Tags:** forms, integrations\
**Created:** [January 12, 2021, 12:22am UTC](https://community.hubspot.com/t/hubspot-tracking-code-scraping-squarespace-forms-incorrectly/30032 "2021-01-12T00:22:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve0verton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/steve0verton/32/44503_2.png) [@Steve0verton](https://community.hubspot.com/u/Steve0verton)\
**Post date:** [January 12, 2021, 12:22am UTC](https://community.hubspot.com/t/hubspot-tracking-code-scraping-squarespace-forms-incorrectly/30032/1 "2021-01-12T00:22:49Z")

</div>

**Use Case**

We have a basic Squarespace form on our website to collect emails for a Newsletter subscription. Logically this should appear as a single form in HubSpot but it is getting created as a new form for every single submission due to a bug in how HubSpot developed the code to uniquely identify forms. This is creating an administrative nightmare and it is not effective in classifying data in HubSpot. We lose the ability to leverage conversion analytics and understanding when contacts arrive from our public website newsletter because every contact created appears to be ceated from a differnet unique form. This is a bug in the HubSpot tracking code and should be corrected. Any workarounds would be appreciated in the meantime. I am trying to think of a way to inject my own javascript to replace ID values in the Squarespace forms ahead of the HubSpot javascript so I can force the proper standardized form identifiers.

**Detailed Technical Analysis**

Grab the **collectedforms.js** from embedded in HubSpot’s main tracker code:

- [https://js.hscollectedforms.net/collectedforms.js](https://js.hscollectedforms.net/collectedforms.js)

After beautifying the javascript, line 3679 shows where HubSpot specifically caters to [squarespace.com](http://squarespace.com) domains. You can also search for “squarespace” to find the Squarespace-specific block of code. This block describes how the form ID is built to be ingested by the tracking code. It is interesting to see that HubSpot specifically developed the tracking code to support Squarespace websites.

The general problem with the **collectedforms.js** script is that the Squarespace “yui” selector is used and it should not be. Instead the **“collectionId”** or **“formId”** identifiers should be used to uniquely identify a form to scrape and pass into the **“formGuid”** field in the HubSpot Form submission API. I would then use the form class name to provide a pretty name back to HubSpot so contacts have something meaningful added versus a randomly generated number, which inflates the Hubspot marketing forms tremendously. Maybe the form class could pass into the **“pageName”** field or **“pageUri”** when the tracker script pushes back to HubSpot.

I am not an expert in javascript, but I would be open to trying to figure out how to overwrite values on the page to correct the problem on the fly so HubSpot’s collectedforms.js script does not see the randomly generated “yui” values.

Any ideas?

Reference on Squarespace “yui” selectors:

> **[In Squarespace, what are the differences between #block-yui and #yui...](https://sf.digital/squarespace-solutions/in-squarespace-what-are-the-differences-between-block-and-yui-selectors?rq=yui)**
>
> In Squarespace there are some unique naming conventions for the classes and IDs on Squarespace, as well as some more obvious ones that are more self explanatory, like “site” and “Header”. The main ones to be aware of are: Collection IDs Item...

---

<div class="post-metadata">

**Author:** ![Steve0verton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/steve0verton/32/44503_2.png) [@Steve0verton](https://community.hubspot.com/u/Steve0verton)\
**Post date:** [January 12, 2021, 1:26am UTC](https://community.hubspot.com/t/hubspot-tracking-code-scraping-squarespace-forms-incorrectly/30032/2 "2021-01-12T01:26:21Z")

</div>

As an example of the administrative problems created, deleting a redundant form created by every single form submission creates a problem when clicking the link into that respective form from the contact timeline. Viewing the deleted form just opens a window with an endless spinning circle.

---

<div class="post-metadata">

**Author:** ![aidanh](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aidanh](https://community.hubspot.com/u/aidanh)\
**Post date:** [March 20, 2025, 1:58am UTC](https://community.hubspot.com/t/hubspot-tracking-code-scraping-squarespace-forms-incorrectly/30032/3 "2025-03-20T01:58:41Z")

</div>

Did you find a solution or workaround? Still appears to be an issue
