Custom JavaScript

Add custom JavaScript to specific sections for advanced site enhancements, third-party integration, or analytics, while keeping code organized, testable, and optimized for performance and accessibility.

Last updated About 2 months ago


Overview

The Custom JavaScript block empowers you to add your own JavaScript code to specific areas of your site. This flexibility allows for tailored enhancements, advanced integrations, and unique interactive features that go beyond standard configuration options. Use this block to precisely target changes, ensuring they are easy to manage and update.

⚠️ Important: Always thoroughly review and test your scripts before publishing. Custom JavaScript affects site performance and user experience, so responsible use is essential.

Available in sections

The Custom JavaScript block can be applied within these sections:

  1. Custom code

Key components and functionality

The settings within the Custom JavaScript block are designed to help you efficiently manage, organize, and label your custom scripts.

Custom JavaScript code

This setting is the main entry point for your custom JavaScript. Use it to add scripts that enhance functionality, connect third-party tools, or introduce additional tracking.

  1. You can enter any valid JavaScript for the desired section.

  2. The input is empty by default.

  3. Code added here executes only within the section where the block is used, minimizing the chance of unintended effects in other areas.

💡 Tip: Keep your JavaScript concise and reliable. Well-written scripts are easier to maintain and less likely to cause issues.

Usage notes

⚠️ Important: Test all JavaScript on a non-production version of your site before publishing publicly. Errors can impact visual display, break navigation, or create accessibility barriers.

  1. Responsive design

    1. Ensure scripts behave as expected across all device types and screen sizes.

  2. Performance

    1. Write efficient code to maintain fast load times, especially on mobile.

  3. Accessibility

    1. Confirm your scripts do not interfere with keyboard navigation, readable content order, or screen reader compatibility.

  4. Security

    1. Only include trusted and vetted scripts to protect site integrity and customer data.

Regularly updating, labeling, and testing your scripts will make the most of the Custom JavaScript block and ensure ongoing site flexibility and stability.