Thanks to Wix’s user-friendly interface, adding custom JavaScript to a Wix site is straightforward. Here’s how you can add the provided JavaScript code to your Wix website so that it appears on all pages:
Step 1: Log in to Your Wix Account
- Access your Wix account: Log in to the Wix website with your credentials.
Step 2: Access Your Site’s Dashboard
- Go to the Dashboard: Once logged in, navigate to the site’s dashboard for the edit you want.
Step 3: Open the Tracking & Analytics
- Navigate to Tracking & Analytics: From your site’s dashboard, look for a section or menu item named ‘Settings’ or ‘Manage Website’. Under this, you should find an option for ‘Tracking & Analytics’ or something similar.
Step 4: Add a New Custom Code
- Click on ‘New Tool’ or ‘Add New Tool’: Inside the Tracking & Analytics section, you’ll find an option to add a new tool. This is where you can add custom JavaScript.
- Select ‘Custom’ from the options: You’ll likely be presented with several tools or scripts to add. Choose the option that allows you to add custom code.
Step 5: Add Your JavaScript Code
- Paste your JavaScript code: In the space provided, paste the JavaScript code you want to add to your site.
- Name your custom code: Give your custom code a recognizable name for future reference.
- Choose where to place the code: You can typically set the code in your site’s header, body, or footer. For most JavaScript, the header is the recommended location.
- Apply to all pages: Select the option to apply this script. Wix also allows you to include or exclude specific pages if needed.
Step 6: Save and Publish
- Save your changes: After adding the code, save your changes.
- Publish your site: For the changes to take effect on your live site, you need to publish the site. There’s usually a ‘Publish’ button at the top right corner of the Wix editor.
Step 7: Test the Integration
- Visit your website: After publishing, visit your website to ensure the script works correctly.
- Inspect the page: You can check the page source or use browser developer tools to see if the script loads on every page.
Additional Notes
- The exact names of menus and options might vary slightly depending on updates to the Wix platform.
- If you’re adding JavaScript that interacts with user data or affects website functionality, ensure it complies with Wix’s policies and guidelines and general web standards and regulations (like GDPR, if applicable).
Following these steps, you can successfully integrate your custom JavaScript into your Wix website.