I published an App Script as a web app and everything runs fine when I use the web app URL.
https://script.google.com/a/macros/[mydomain]/s/[servicekey]/exec
When I go into a Google Site and try to insert a "Google Script Gadget" and select the URL of my web app I keep getting a message that says "The URL is not recognized as a valid Google Script". However, if I copy and past the URL in a new browser window the web app comes up just fine. Is it not possible to insert a published web app into a Google site?
I even tried using the old naming convention as described here but no luck.
What is the original 'container' of your script ? did you develop it from a spreadsheet ? as a standalone script file ? or in you site script editor ? The resulting webapp urls are different when hosted in a site , here is an example that can be inserted :
note that if a script is hosted in the site this url is not useful since the script is available directly by its name. I must admit that the interface is not really clear about that, nor is the documentation but that's the conclusion I came to, please don't consider this as an absolute truth ;-) maybe someone from Google could confirm (or not).
EDIT : the 'old notation' that you mention is still working for me for a script developed as a standalone script file using the key associated to the url structure shown above... I just copied/pasted the key without anything else where the keyxxx... stands.
Confirming that the URL format below works when inserted as a Apps Script Gadget URL in Google Sites.