Custom JSAgency settingsWhite label

How to Add Custom JS to GoHighLevel (Agency and Sub-Account)

Where the Custom JS field lives in GoHighLevel agency settings, how to add a script safely, and how sub-account scoping works. Plus a testing checklist.

Agency owners usually go looking for the Custom JS field when they want a small UI tweak, a chat widget or a tracking script. The field exists, but it applies to the whole agency, and a bad script affects every user. This guide covers where it lives, how to add code, how to limit it to certain sub-accounts, and how to test it.

Where Custom JS lives in GoHighLevel

The main place is the agency's company settings. HighLevel's help article describes a Custom Code section with a Custom JavaScript field for things like live chat widgets, Google Analytics and tracking pixels. There is also a Custom CSS field for styling and hiding elements.

As of October 2026, the path most guides give is:

  1. Switch to Agency View (not inside a sub-account).
  2. Open Settings, then Company.
  3. Go to the Whitelabel tab.
  4. Find the Custom JS box and paste your code.
  5. Save, then hard-refresh your browser tab.

One community guide lists the same sequence: Agency, Settings, Company, Whitelabel, the Custom JS box, then save. HighLevel changes its settings layout from time to time. If a label doesn't match, look for the custom code section under the agency's company or white-label settings.

The field is part of the white-label settings, so what you see can depend on your plan. If it's missing, ask HighLevel support rather than hunting for a workaround.

Agency method: step by step

Do this the same way every time so you can undo it.

  1. Copy the existing contents first. Paste whatever is already in the Custom JS box into a text file. That's your rollback.
  2. Add your snippet at the bottom, not the top, unless the snippet's instructions say otherwise. Keep a comment above each snippet saying what it does, who added it and when.
  3. Save and hard-refresh. Custom JS loads with the page, so a normal tab that's already open won't pick up changes.
  4. Check the browser console. Open your browser's developer tools and look for red errors on the dashboard, Conversations, Contacts and Calendars pages.
  5. Test with a second login. Use a user with limited permissions, because that's what your clients see.

Agency-level code applies to every sub-account under the agency. That's the point for something like branding, and a risk for anything else.

Sub-account method: scope by location

There's no obvious "Custom JS" box in each sub-account's Business Profile. A feature request on HighLevel's ideas board asks for a dedicated location-level custom code field, which suggests it isn't there as a native option. That request could be answered at some point, so check your own sub-account settings.

In the meantime, agencies scope the script themselves. While you're working inside a sub-account, its location ID typically appears in the page URL. Your agency-level script can read that and only run for the accounts you list. A HighLevel ideas thread shows people doing this for per-client logos, pasting code into the agency's custom JS section with a map of location IDs.

A bare-bones pattern looks like this:

(function () {
  try {
    var allowed = ["LOCATION_ID_ONE", "LOCATION_ID_TWO"];
    var match = window.location.href.match(/location\/([^\/?#]+)/);
    var id = match ? match[1] : null;
    if (!id || allowed.indexOf(id) === -1) return;

    // your change for those sub-accounts goes here
  } catch (e) {
    console.warn("Custom JS skipped:", e);
  }
})();

The URL structure is the part most likely to change, so treat the matching line as something to re-test after HighLevel updates. See the location ID glossary entry if you need to find an ID, and the sub-account entry for how accounts relate to the agency.

Other places code can go

Custom JS in company settings only affects the dashboard. Two other spots get confused with it:

If you want to read or move data, you may be better off with the API. Our private integration token guide explains how to set that up for a single sub-account.

How to add Custom JS safely

HighLevel's own help article calls custom JS and CSS powerful but unsupported, warns that changes to the core UI can break your code, and says to test thoroughly. Treat that as the rule.

Where the native method gets slow

The Custom JS box works, but it's a single text field for the entire agency. That has costs:

This is manageable for a few small tweaks. It gets tiring if you're also trying to maintain dark mode styles, contact lookups and file previews yourself.

Where Power-Ups fits

Power-Ups is one of the six RGS Tools, made by Revenue Generating Solutions. It runs inside GoHighLevel through one Custom JS line, so you paste a single line into the field described above instead of maintaining your own scripts. It's $19/month per agency with unlimited sub-accounts, a 7-day free trial and cancel any time.

It includes four features: Contact Peek, File Preview, Dark Mode and Duplicate Contact. For walkthroughs, see our posts on dark mode in a sub-account and finding and handling duplicate contacts. RGS Tools isn't affiliated with HighLevel Inc.

You don't need it to follow the steps above. If you only need one small tweak, the native field and a careful snippet are enough.

Questions

Where is the Custom JS field in GoHighLevel?

Switch to Agency View, open Settings, then Company, and look for the Custom JS box on the Whitelabel tab. Menu labels can change, so check the current layout if you don't see it.

Can I add Custom JS to just one sub-account?

As far as we can verify, there is no dedicated Custom JS field inside each sub-account's settings. The common workaround is to add the script at the agency level and have it check the location ID before it does anything.

Can custom JavaScript break my GoHighLevel account?

It can break the interface you see, because the script runs in every user's browser on every page load. It doesn't change your data on its own, but a bad script can still make pages misbehave, so test it with a spare sub-account first.

Is the Custom Code workflow action the same thing?

No. The workflow Custom Code action runs JavaScript or Python as a step inside an automation and returns output for later steps. It doesn't change what users see in the dashboard.

Features in this guide

Contact Peek

Opens a contact in a window over the Opportunities board instead of leaving the board.

File Preview

Hover a file to preview it; click to view it in the page instead of a new tab.

Dark Mode

A moon/sun button in every sub-account header. Each user picks per sub-account.

Duplicate Contact

Duplicate a contact from its page or the list, choosing which fields come along.

Keep reading

Power-Ups

GoHighLevel Dark Mode for Sub-Accounts: Your Options in 2026

What GoHighLevel dark mode options exist for sub-account users, how agency Custom CSS and browser extensions compare, and a per-sub-account toggle option.

4 min read
Power-Ups

How to Duplicate a Contact in GoHighLevel

How to duplicate a contact in GoHighLevel when there's no copy button: the duplicate settings that block it, the API method, and a one-click option.

4 min read
All 6 tools, all 34 features: $149/month

Every tool above plus everything we release next. $302/month bought separately. 7 days free, cancel any time.

Start the bundle free