Load Site Scripts on a Self-Managed Project

Load the scripts a Wix project provides in a self-managed headless project. 1 script tag adds Wix Analytics page views, the project's cookie consent policy, the favicon, SEO tags from the dashboard, and custom code marked Essential. It works on any domain and with any framework, and it doesn't need backend code.

Wix's Astro integration and a static site you upload to Wix already include this tag.

To load the scripts:

  1. Copy the project's client ID.

    In the project dashboard, go to Settings > Development & integrations > Headless Settings, and copy the Client ID under Headless clients.

    In a project that has a wix.config.json file, the appId value is the client ID. A client you create later in Headless Settings works the same as the client Wix created with the project. See Set Up a Headless Client.

  2. Add this tag to the <head> of every page, and replace YOUR_CLIENT_ID with the client ID.

    In a framework, add the tag once, in the root layout or HTML template.

    Copy

    Keep the tag's src. The tag reads the client ID from data-client-id, and Wix serves the current script from that URL. Pasting the script's contents into the page doesn't pick up later changes. Wix ignores a second copy of the tag on the same page.

  3. Open a page and inspect <head> in the browser's developer tools.

    Tags that Wix added have wix-seo-tag="true". If none appear, check the console for a warning.

What the script adds

WhatDetails
Page viewsVisits and page views in Wix Analytics, including when the visitor moves to another path with client-side routing. This doesn't include event tracking with trackEvent(), which is available with the Astro integration only
Cookie consentThe project's consent policy, applied to the other scripts this tag loads
FaviconThe favicon set in the dashboard. If the project has no favicon, the script doesn't add an icon tag
SEO tagsTitle, canonical link, Open Graph, Twitter, and structured data from the project's SEO settings, for the URL the page first loaded at
Custom codeCustom code from the dashboard marked Essential, plus Google Analytics and Google Tag Manager when they're connected, in consent mode

Tags your page already has

Wix keeps a <title>, <meta>, or <link> the page already has, and skips its own tag of the same kind. For example, an existing <title> or <meta name="description"> stays, and an existing <link rel="canonical"> stays. Wix can still add a different tag, such as og:title, when the page doesn't have that one.

The script adds SEO tags in the browser, for the URL the page first loaded at. The tags don't change on client-side route changes. Crawlers that don't run JavaScript don't see them. To control the tags search engines read, render them on your server. See About SEO for Self-Managed Headless Projects.

Changes in the dashboard can take up to 10 minutes to show up on the site.

The script stores an anonymous visitor token in localStorage, under the key wixSiteScript: followed by the client ID. Wix uses the token to recognize the visitor for analytics and for the scripts it loads. The token isn't an admin credential, and it isn't the headless client secret. The script doesn't set a cookie on your domain for that token.

The tag also loads the project's consent policy and applies it to analytics, custom code, and marketing tags. On a new project, that policy allows every category until a Wix user sets a stricter policy or a visitor makes a choice. A cookie banner appears only when the policy requires a banner. It doesn't appear under the default policy. For how that default works on a project built with the Astro integration, see Manage Cookie Consent.

Content security policy

If the site sends a Content Security Policy, allow:

  • Scripts from manage.wix.com and static.parastorage.com, and inline scripts. The tag injects inline scripts as well as files.
  • Requests to www.wixapis.com and frog.wix.com. The script sends analytics page views to frog.wix.com.
  • Images from static.wixstatic.com, when Wix hosts the favicon or a social image.

Google Analytics, Google Tag Manager, and other connected tags load from their own hosts. Allow those hosts too.

See also

Last updated: 26 October 2026

Did this help?