Error "Initial messages API call failed"


#1

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…e42af092ecf7cc47dbccb61cb14d76&hubspotUtk=71e42af092ecf7cc47dbccb61cb14d76 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);

#2

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


#3

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


#4

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.


#5

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,


#6

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!


#7

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.


#8

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


#9

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:


#10

@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?


#11

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?!


#12

Hey Everyone,

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

-Zack


#13

Hey Everyone,

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

-Zack


Script error windows