To get the script url to use in the code. In script record check the checkbox available without login and then save. Then the external available link will be available there.

To enable or disable web store triggers for a user event script deployment:
Open the script deployment record, for a user event script, for editing. For example, go to Customization > Scripting > Script Deployments. Locate the appropriate script deployment record and click the corresponding Edit link.
On the script deployment record, on the Context Filtering tab, specify the execution contexts for the script. If you select Web Application or Web Store, those contexts are enabled for your script. If you do not select them, they are disabled for your script.
Click Save.