You can use the Embedded Script API to inject custom script tags to the head tag of a site.
If you have custom keys or data, you can use dynamic parameters in your embedded script.
You can also listen to predefined Wix events, and report and listen to custom events.
The embedded script can include dynamic parameters. For example:
<script type=“text/javascript” id=“xyz-script-loader” async defer src=“//js.hs-scripts.com/{{abcid}}.js”></script>
{{).The MISMATCHED ANONYMOUS DEFINE() MODULES... error is a common issue when working with AMD/UMD bundled scripts. The error occurs when an embedded script defines an anonymous module, either because it's bundled with AMD or it adds a script tag to the head containing an anonymous module.
To resolve the issue, try the following:
requirejs exists on the window. If it does, load the script via requirejs instead of adding the script to the <head>. This approach is suboptimal and might still lead to race conditions and errors.For more information on this issue, see RequireJS: Common Errors.
Last updated: 31 March 2026