I have asked this question before but it seems i got misunderstood therefore i decided to ask again but this time with alot of information:
For the lazy reader my go
Is it possible to check if a site has a certain JavaScript?
You could do two things, where I think the one using JavaScript would be easier to implement.
Using PHP:
Using JavaScript
Self hosting
Is it possible to check if the javascript is running without errors?
This one is a bit more complicated as you have check this during runtime. Imagine the user of your script extends or modifies your code or simply uses it in a wrong way or has something that conflicts with your code. Maybe this code is never reached, as it invokes some user interaction, that may or may not be triggered.
One possibility would be to send an AJAX request back to you, when an error occured. You can check out window.onerror for that purpose:
window.onerror = function(message, url, lineNumber) {}
This will give you some detailed information, that you can pass to your server using an AJAX request.