Is it traccar error?

Manuel Suáreza year ago

Hi , I am trying to integrate the chatwoot sdk in traccar but I have an error, I am not an expert or anything like that but this script should only be added in the body and it works but when I add it in traccar it gives me a 404 error , this is the script that I add to the body:

    <script>
      (function(d,t) {
        var BASE_URL="https://chat.location.mx";
        var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
        g.src=BASE_URL+"/packs/js/sdk.js";
        g.defer = true;
        g.async = true;
        s.parentNode.insertBefore(g,s);
        g.onload=function(){
          window.chatwootSDK.run({
            websiteToken: 'Co6XfzJbD5bbP8CXWFEhCZHt',
            baseUrl: BASE_URL
          })
        }
      })(document,"script");
    </script>

It is worth mentioning that if I use this same script in an html or wordpress file, I even did a test with codePen it works perfectly

Anton Tananaeva year ago

Why would it be a Traccar error?

Manuel Suáreza year ago

It is a 404 error, as I mentioned the problem is that in other sites it works correctly here is an example: https://location.mx/ this url is made with wordpress and contains the same SDK script.

Failed to load resource: the server responded with a status of 404 ()

Example image

Example error

I ask since I don't understand why it doesn't work with traccar
I don't know if I should add the script in a document other than index, maybe I'm not adding it in the right place?

Anton Tananaeva year ago

Does Traccar work without it? If yes, then the issue has nothing to do with Traccar. It could be a problem with the way you integrate it.

Manuel Suáreza year ago

Ok I appreciate the answer surely if I don't know how to add it but I will investigate. Thank you

Cristiana year ago