Skip to main content
Referly’s portal settings cover most of what people want to change, but sometimes you need something specific — a font that matches your brand exactly, your analytics tool, or a support chat bubble. The Custom Code page lets you add your own CSS and JavaScript to your affiliate portal to do that. To find it, open Settings from the left sidebar, go to Affiliate Portal, then select Custom Code. There are two boxes: Custom CSS for how things look, and Custom JavaScript for behavior. You can use one or both.
Saving custom code needs the Business plan or higher. See plans and features.
Anything you add here runs on your affiliate portal only — every page of it, including login and sign-up. It doesn’t touch your own website, and it doesn’t affect your Referly dashboard.

Add custom CSS

The Custom CSS box changes how your portal looks. Use it for adjustments the branding and login page settings don’t cover. Write plain CSS, the same as you would for a website:
To target the right thing, open your portal in a browser, right-click the element you want to change, and choose Inspect to find its name. If you’re not comfortable doing that, this is a good task to hand to whoever built your website.

Add custom JavaScript

The Custom JavaScript box is for adding behavior — most often a tracking or analytics snippet, or a support chat widget.
Paste the code only, without the surrounding script tags. Most snippets you’re given start with <script> and end with </script> — delete those two lines and keep what’s between them. Referly adds the wrapper for you.
For example, if a tool gives you this:
you paste only this:
If you need your code to wait until the page has loaded, do it like this:

What isn’t allowed

To protect your affiliates’ accounts, some risky JavaScript is stripped out before it runs. Code that runs text as code or rewrites the page wholesale won’t work, including eval, document.write, execScript, and setting innerHTML or outerHTML directly. Timers written with quoted text instead of a function are also rewritten. If a snippet you paste relies on any of those, it stays silent instead of running. Ask the tool’s support team for a version that doesn’t use them, or load their official script through a tag manager on your own site instead. CSS is checked too, so anything that tries to pull in outside files or scripts through your stylesheet is removed.

Save and check your work

As soon as you edit either box, a Save Changes button appears at the bottom right. Your code isn’t live until you select it.
When the “Custom code saved successfully” message appears, your code is live.
There’s no preview on this page, so open your affiliate portal in a new tab and look at it there. Check the login page and a page or two inside the portal, on a phone as well as a computer, since a styling change that looks right on a wide screen can break a narrow one.

If something breaks

Custom code runs on every page of your portal, so a mistake can hide a button your affiliates need or stop a page from working. If that happens, come back to this page, clear the box you changed, and select Save Changes. Your portal returns to normal right away. Nothing here can damage your program’s data — the worst case is a portal that looks or behaves wrong until you undo it. A few habits that save trouble:
  • Add one change at a time and check the portal after each, so you know what caused a problem.
  • Keep a copy of your code somewhere outside Referly before you make a big edit.
  • Avoid hiding anything affiliates need, like the payout or referral link sections.

Set up your branding

Change logos and colors without writing any code.

Login and sign up

Pick a layout and customize your portal’s first screens.

Contact widget

Add a built-in way for affiliates to reach you, no code needed.

Custom domain

Serve the portal from your own web address.
Last modified on July 21, 2026