Wix Editor: Embedding Custom Code on Your Site
Embed custom code snippets to the head or body of your site's pages to verify site ownership, monitor your site's traffic, track user activity, and measure the success of your campaigns.When adding the custom code, you can choose to include it on all your site's pages or specific pages only. Whichever you choose, these snippets are always invisible to your site visitors.Important:
Wix does not provide support for technical issues with third-party code snippets. If you have an issue with your code snippet, please contact the provider directly. Tracking scripts such as Google Analytics, Google Tag Manager, and Facebook & TikTok pixels do not work through custom code. You can connect these to your site with marketing integrations.
In this article, learn more about:
Adding custom code to your site Working with third-party codeAdding custom code to your siteBefore you begin:Make sure that your site is published and has a connected domain.To add custom code to your site:
Go to Settings in your site's dashboard. Click Custom Code in the Advanced section. Click + Add Custom Code at the top right. Paste the code snippet in the text box.  Enter a name for your code.
Tip: Give it a name that is easy to recognize so you can quickly identify it later.  Select an option under Add Code to Pages:
    
All pages: This adds the code to all of your site's pages, including any new pages that you create in the future. 
        
Choose whether to load the code only once per visit, or on each page your visitor opens.   Choose specific pages: Use the drop-down menu to select the relevant pages.   Choose where to place your code under Place Code in:.
    
Head Body - start Body - end   Click Apply.Working with third-party codeWhen you get a code snippet from a third party, they should give you instructions about where to place the code (head or body) and how to use it. The placement of your code is crucial for it to load and execute properly. Wix does not provide support for any technical problems you may have with third-party code snippets. If you have a problem with a code snippet from a third party, you should contact the provider directly for help.FAQsClick a question below to learn more about embedding custom code on your site.How do I embed visible code on my site?Add an iFrame with HTML code to display visual content on your site.  If you want your site's elements to interact with your site, and for more advanced features such as building web applications, head to Velo by Wix.What happens if change the domain on my site?Your code snippets are associated with a specific domain. If you assign a different domain to your site, your code snippets will be deleted. There is no need to add code snippets to your secondary domain, as all traffic is redirected to your primary domain.How can I make sure my site is compliant with privacy laws when using custom code?To help your site be compliant with privacy laws such as the GDPR, we recommend you categorize your custom code. This helps manage and control the data collected through your site.Where should I place my custom code on my site?The placement of your custom code depends on the instructions provided by the third party from which you received the code. Generally, place tracking and verification codes in the head section, and other functional scripts in the body section. Always follow the third-party provider's instructions for optimal performance.What should I do if I encounter issues with third-party code snippets? Wix does not provide support for technical problems with third-party code snippets. Contact the provider directly for assistance if you encounter any issues.Can I load the custom code only once per visit? Yes, when adding custom code to all pages, you can choose to load the code only once per visit or on each page your visitor opens. Select the appropriate option under Add Code to Pages.Can I use custom code for advanced features like web applications? For more advanced features such as building web applications or if you need your site's elements to interact with your site, use Velo by Wix. Velo provides tools and APIs to help you create complex, dynamic web applications.