Solo allows you to add a custom script to the <head> section of your website – if it has a connected custom domain. With custom scripts, you can extend your Solo website with functionality such as a chatbot, animations, analytics or other apps. We currently have tested with a range of example scripts but are continuing to test with more.
You can add a custom script to your Solo website by following the steps below:
- Visit the designer
- In the top toolbar, click [Settings]
- In the Settings right sidebar, scroll down, and toggle on Custom code
- In the modal that appears, you can add your custom code (e.g. <script>)
- Click [Save]
- In the right top toolbar, click [Publish]
Custom scripts cannot be previewed via the Preview button in the top toolbar nor on your soloist.ai/handle. They will only be loaded on your custom domain (e.g. yourdomain.com).
Some other common questions and answers:
- You can also link to an externally hosted CSS files to change the styling of your website but this may yield mixed results.
2. The custom code or script will be inserted into the <head> section of your website for all pages. If you wish to insert custom code directly into a section of your website, you can use the code embed section.
3. Async and defer attributes should work
4. We do enforce CORS. You can try adding the “no-cors” option to your fetch calls, but keep in mind that it has limited usefulness since you won’t be able to read the response. This mode is mostly helpful when the request is used for things like tracking or analytics, where the response data isn’t needed.
5. CDNs and other image hosting providers, often added the header, “access-control-allow-origins: *” and so they are not impacted by CORS
Soe
If your custom <script> doesn’t work, please contact us at support@soloist.ai and we may investigate. We do suggest testing your script first with JSBin or if you are importing scripts, host them at Netlify Drop.