Troubleshoot Webflow

Custom code not running on a Webflow site

Even though a script or embed works within the preview environment it does not function when a site is published.

Possible issues

  • Script fails to function
  • Script is restricted to a single page
  • There are console errors.

Check these in order

Investigate in this order. Usually an issue will be identified within the first couple of steps.

  1. 1

    Published site

    Whilst previews and custom code may behave differently on a published site, replicate functionality here.

  2. 2

    Loading

    Review the script call and examine the initial console error.

  3. 3

    Initialisation

    Confirm that the correct selectors have been used, and that the DOM is ready. Also review the sequence of dependencies.

  4. 4

    Limitations

    Consider factors including user consent, permissions and content security.

Always review the initial console error.

Enable the browser console and Network functions. Then analyse the script reply and content type together with the selectors and dependency sequence for the published URL. As initial script errors can affect the ability to initialise further scripts, address the first error before duplicating the script library.

Whilst some code can be activated within the Webflow preview, it is still necessary to test on a published site. Consider user consent and content security limitations. Never include private API keys within embed code.