App freez if countly function wasn't called

I have question, for example lets assume that for some reason countly js wasn't downloaded via web browser.

Right now if this happens my app freez and users are not able to even log in, what is best way to build Countly analytics in project so my project will continue to work even if something goes wrong with countly server and js will not be downloaded? My first thought was to wrap everything in try catch but i don't like it. Mostly custom events cant be triggered so everything is freezing.





  • Official comment

    Hello Andrii,

    Thanks for reaching out. This depends on what exactly is the reason for the freeze. If used in async mode, then nothing should really happen even if the JS is not loaded. You can also load it using a third-party CDN, so that even if the Countly server is down, the script will still load.

    Comment actions Permalink
  • Turns out it was because there was no global Countly variable, fixed it by defining empty object in case there is no Countly in global namespace

    Comment actions Permalink

Please sign in to leave a comment.