Tracking code associated with a business unit. Wrong business unit analytics data distribution.

Recently, we created a new business unit (now we have 2 of them: BU1 and BU2) and set the tracking code for the new BU2 business unit: Settings → Account Setup → Tracking & Analytics → Tracking code → Current view (includes BU1, BU2) → Selected: BU2. The BU2 tracking code contains the parameter “?businessUnitId=xxx” (BU1 doesn’t contain it).

Strange behavior: all contacts, all non-HubSpot forms that are filled out on this BU2 website are marked as entities of the BU1 business unit, and not the BU2, which corresponds to the parameter “?businessUnitId=xxx”.

What could be the problem, is there any additional configuration of the BU2 business unit needed so that the analytics data is distributed correctly between business units?

Hello @WServiceDesk,

Just wanted to check if you have multiple tracking codes installed on one page. Currently, you should not install multiple HubSpot tracking codes on one page. If there are multiple HubSpot tracking codes installed, the first one to load on the page will fire; any subsequent HubSpot tracking codes will not load. I would also like to share this knowledge base with troubleshooting steps here.

To our top experts, @Aakar @Josh @Olivia_Bagnall any suggestions to @WServiceDesk matter?

Thank you,

Pam


@PamCotton wrote:

Hello @WServiceDesk,

Just wanted to check if you have multiple tracking codes installed on one page. Currently, you should not install multiple HubSpot tracking codes on one page. If there are multiple HubSpot tracking codes installed, the first one to load on the page will fire; any subsequent HubSpot tracking codes will not load. I would also like to share this knowledge base with troubleshooting steps here.

To our top experts, @Aakar @Josh @Olivia_Bagnall any suggestions to @WServiceDesk matter?

Thank you,

Pam

The BU2 website has only one HubSpot tracking code, which contains the corresponding “?businessUnitId=xxx” parameter.

I found out that only original HubSpot Forms support business units. (REF: Associate assets with Brands → Forms → “You can only associate a form with a business unit when creating the form. To change a form’s business unit, you’ll need to recreate the form. Non-HubSpot forms are automatically associated with the account’s default business unit and cannot be changed”).

So, I created a workflow that will set the correct business unit based on the contact’s “First Page Seen” property. If this property contains “xxxxxx.com”, set to “BU2”.