Embedding Custom Code on Your Site
2 min read
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.
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.
Learn more about:
Adding custom code to your site
Important:
Before you begin, make sure that your site is published and has a connected domain.
- 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.
Notes:
- 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.
- To help your site be compliant with privacy laws such as the GDPR, we recommend you categorize your custom code.
Working with third-party code
When 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.
Want to embed visible code?
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.
Did this help?
|