Skip to main content

Global Custom JS/CSS Size Limits in Mida

Updated over 2 weeks ago

When using Mida's Global Custom JavaScript or CSS feature, it's important to understand the size constraints that apply to your code.

What is Global Custom JS/CSS?

Global Custom JS and CSS allows you to inject custom JavaScript or CSS code that runs across all your experiments and pages where the Mida script is installed. This is useful for:

  • Shared utility functions

  • Global styling overrides

  • Analytics integrations

  • Custom tracking code

Size Limits

Field

Maximum Size

Global JavaScript

~64 KB

Global CSS

~64 KB

Both fields support approximately 65,535 characters of ASCII code. If your code contains special Unicode characters (emoji, non-Latin scripts), the effective limit may be lower due to multi-byte character encoding.

Rule of Thumb

For most users: 64KB is enough for approximately 1,000-1,500 lines of typical JavaScript or CSS code. This is more than sufficient for custom tracking, utility functions, and style overrides.

If your custom code is under 500 lines, you're well within the safe zone and have nothing to worry about.

What Happens If You Exceed the Limit?

If your code exceeds the size limit, the save operation will fail and you'll receive an error. Your previous code will remain unchanged.

Did this answer your question?