Custom code hooks
When the built-ins run out, five escape hatches keep you moving without leaving Janus. Use sparingly; each one is a small piece of software you now maintain.
1 · Custom JS targeting condition
The condition builder's Custom JS runs your snippet in the visitor's browser at trigger time; return truthy to show the popup:
// only visitors with your loyalty SDK loaded, above tier 2
return window.myLoyalty && window.myLoyalty.tier > 2;
?ps_preview link after any edit.2 · Execute code on signup
In Settings → Tracking → Developer, a JavaScript hook runs in the browser on every successful opt-in, with the subscriber's name, email, phone and properties (quiz answers) in scope:
// e.g. a TikTok pixel lead event + your own endpoint
ttq && ttq.track('SubmitForm');
fetch('/hooks/new-subscriber', {
method: 'POST',
body: JSON.stringify({ email: email, answers: properties })
});
For pixel-only needs, prefer the checkbox pixels; for provider syncs, prefer integrations; this hook is for everything else.
3 · The Custom code element
The Advanced → Custom code element drops raw HTML into a step: badges, embeds, markup Janus doesn't have an element for. It supports variables, so <div data-code="{{code}}"> works.
4 · Custom code actions
Any button's action chain can include Custom code (JS): run something exactly when a specific button is clicked, between a Track click and a Go to step.
5 · Edit CSS
Element-scoped raw CSS in the inspector's Advanced mode; see Design & styles.
Which hatch, when
| Need | Reach for |
|---|---|
| Show/hide based on app state | Custom JS condition |
| Fire a tag on signup | Signup event listener → pixels → this hook, in that order |
| Unsupported markup in a step | Custom code element |
| Side effect on one click | Custom code action |
| A style the panel can't express | Edit CSS |
| Open popups from your own UI | Not code-hatch territory; that's the SDK doing its normal job |