About Embedded Scripts

An embedded script is an HTML or JavaScript fragment that loads in the site page head or body. In Studio Two you add one from the Code tab through the Wix Extension Builder, so the script is part of the site project.

For when to use an embedded script, script types and consent, dynamic parameters, and how embedding works on other development paths, see Embedded Scripts.

Anatomy of an embedded script

An embedded script in a Studio Two project is a configuration file and the HTML fragment that gets injected:

  • The HTML file is the fragment injected into the page.
  • The configuration file declares the script's name, placement, script type, and path to the HTML file. For the full set of fields, see Embedded Script Extension Files and Code.

The generated folder also includes logger.ts, a small module the generated HTML loads. You can replace that module, or remove the script tag that loads it.

You generate the files first, then edit the HTML. For that workflow end to end, see Build an Embedded Script in Studio Two.

How embedded scripts are used

  • You add the script from the Code tab through the Wix Extension Builder, which puts its files in your site project and registers it.
  • You set a placement of Head, Body Start, or Body End, and a script type that controls cookie consent.
  • After you publish the site, the fragment loads at that placement on the published site.

See also

Last updated: 2 November 2026

Did this help?