How to Add Javascript to your Wix website

Add Javascript to any Wix website in 6 Steps

In this guide we'll show you how to add javascript to any Wix website in 6 steps.  You can use this approach to add any code snippet from 3rd party Live Chat services like Live Chat for Microsoft Teams, MixPanel, Google Analytics, and other 3rd party tools like analytics tools or screensharing tools.

One thing to note is that in order to add a custom javascript code snippet to your website, you'll need a paid Wix website plan with a connect domain name.  

So let's get started. 

Step 1. Go to your Website Dashboard

First, head over to your Wix Dashboard that will look something like this.

Wix Website Dashboard

Scroll down and select the Settings link:

Step 2. Select the Custom Code option in Advanced Setting

Next, scroll to the bottom of the Settings page to the Advanced section and choose Custom Code link.

Once here, choose a section to add your Javascript code snippet to.  In our case we'll select the Head section and choose 'Add Code'

Step 3. Copy your Custom Javascript Code to your Wix website

So for our example, we are going to embed our Live Chat for Microsoft Teams live chat widget into the Wix website so we can chat with the Wix website visitors right from Microsoft Teams.  You can see an article on grabbing your code snippet for the live chat widget here.

In our case the code snippet looks like this:

Simply copy this into the Edit Custom Code section in your Wix Settings as follows: Add custom code snippet to wix website

Step 4. Enable your Custom Javascript Code snippet on your website

Finally, make sure to enable the custom code snippet you entered above once you Apply the snippet by turning on the toggle button for the snippet.

Step 5. Disable the Wix Chat that is already there

For our case, we want to use the 3rd Party Live Chat application instead of the built in Wix chat because we already use Microsoft Teams and want to continue to use it to chat with visitors.  

To disable the built in chat, just go to the website editor, select the Wix Chat element and click your delete button.  Now Publish your app and your custom code snippet will be active.

Step 6. Preview your Live Site that includes your Javascript code snippet

That's it.  After publishing your Wix changes, simply view your live site to verify your code snippet is active.  In our case we see the 3rd party live chat widget is active in the Wix website.