Error: Server returned with an unhandled status
drgarlic opened this issue · comments
Hi,
I just finished the setup of the server, everything works fine when I try Ackee with the <script> but with ackee-tracker I get an error. I tried removing parameters but no matter what I do, it still crashes when I call .record()
Here's a photo:
And the code
const instance = ackeeTracker.create({
server: 'https://ackee.gawlik.io',
domainId: 'acf48a42-b795-4202-834d-e23531572138',
});
instance.record({
siteLocation: window.location.href,
siteReferrer: document.referrer,
});
Maybe it's stupid, but I really couldn't find the solution,
Anyway, thanks for this great tracker 👍
That's interesting. Can you show me the response of the server? It seems that it returns some kind of XML, which shouldn't be the case.
Looks like document.referrer
returns an empty string instead of undefined
. I recommend to do the following:
// This will use the default attributes which are polished to not include empty strings
instance.record();
// This should work because we're replacing the empty string with undefined
instance.record({
siteLocation: window.location.href,
siteReferrer: document.referrer || undefined,
});
I've already adjusted the next version to do the normalisation on the server instead. It therefore shouldn't happen in the next big release :)
Thanks for the help !