APIs & Integrations

jev
Member

Error "Initial messages API call failed"

We found error in Javascript like this in Chrome Developer Tools

2166894.js:formatted:186 GET https://api.hubapi.com/messages/v2/message/public?portalId=2166894&messages…e42af092ecf7cc47dbccb61c... 404 (Not Found)

2166894.js:formatted:182 Initial messages API call failed


We have put all the script with Hubspot analytic script

    (function(d,s,i,r) {
      if (d.getElementById(i)){return;}
      var n=d.createElement(s),e=d.getElementsByTagName(s)[0];
      n.id=i;n.src='//js.hs-analytics.net/analytics/'+(Math.ceil(new Date()/r)*r)+'/2166894.js';
      e.parentNode.insertBefore(n, e);
    })(document,"script","hs-analytics",300000);
0 Upvotes
12 Replies 12
rybowden
Participant

Error "Initial messages API call failed"

@zwolfson I don’t know what you mean, the only thing we have on the page is the tracking code, Surely that should not throw errors?

0 Upvotes
Mario_Wilkens
Member

Error "Initial messages API call failed"

same problem here:

Initial messages API call failed messageswidgetshell.js:1:1654
XML Parsing Error: no root element found
Location: https://api.hubspot.com/messages/v2/message/public?portalId[...]
Line Number 1, Column 1:

0 Upvotes
rybowden
Participant

Error "Initial messages API call failed"

We are having the same issues on www.esendex.co.uk and a few other of our brochure sites it did fix itself for a bit of time but it has come back. It work for a month with no issues.

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

Error "Initial messages API call failed"

Hi @jonasva, @Oecsike, and @rybowden,

This is the expected behavior when the Messages settings are configured to only show the message to a known contact or a member of a specific list and an unknown visitor is on the site. If you are seeing the 404 response for what should be a known contact or you have different settings selected in Messages, let us know because that may be an issue.

-Zack

0 Upvotes
Oecsike
Member

Error "Initial messages API call failed"

Hello,

i don’t change anything, i only installed the plugin and that’s it. but no matter what i tried, two plugins and the tracking code self and all 3 ways threw an error. but that can’t be normal?!

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

Error "Initial messages API call failed"

Hey Everyone,

The development team is actively working on this use case. I’ll update this thread here when this behavior is changed.

-Zack

zwolfson
HubSpot Employee
HubSpot Employee

Error "Initial messages API call failed"

Hey Everyone,

This should now be resolved. Please update us here if that’s not the case for anyone.

-Zack

Oecsike
Member

Error "Initial messages API call failed"

Hello,

we have the same error. Its a wordpress installation with woocommerce hubspot for wordpress(the plugin from hubspot) and hubspot for gravity forms. How can we resolve this error?

thanks!

0 Upvotes
Not applicable

Error "Initial messages API call failed"

Hi,

I’m encountering the same error after implementing the hubspot tracking script. Is there a way to remove this error message by changing hubspot api/account settings?

Thanks,

zwolfson
HubSpot Employee
HubSpot Employee

Error "Initial messages API call failed"

Hi @jev,

The 404 error here means that the cookie in the browser where you are seeing that is not attached to any known contact and you have restricted the message to show to known contacts only. If you were to fill out a form (thereby attaching your cookie to a contact record) you would see that request get a 200 OK back and the messages widget would display.

Let me know if you have any questions.

-Zack

0 Upvotes
jev
Member

Error "Initial messages API call failed"

Thx @zwolfson for your reply. It this just Warning (Not Error)? will this affecting the hubspot tracking?

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

Error "Initial messages API call failed"

While it is an error saying that the contact that it’s looking for doesn’t exist (hence the 404 status) it will not affect the HubSpot tracking.

0 Upvotes