window.ef object is available on every funnel page. Use it in Client script nodes, in inline scripts, or anywhere on the page to work with tags, visibility, flow control, and timing — without loading the full funnel engine.
Tags
Add, check, or remove tags (same as Add tag / Has tag nodes).
Flow control
Advance to the next step from a client script with
ef.nextNode().Visibility
Check if an element is visible or wait until it appears.
Timing
Delay execution with
ef.wait().Where you can use it
- Client script node — Your script runs in the page; you can call
ef.addTag(),ef.nextNode(),ef.waitForVisible(), etc. The flow does not auto-advance after a client script; callef.nextNode()when you want to continue. - Any inline or page script —
window.efis defined early, so you can use it inonclick, in a<script>block, or from other JS. - Click tracking — Buttons or links with
data-ef-add-tag="tagname"will add that tag when clicked (no client script needed).
Tags
Tags are stored in cookies (same as the Add tag and Has tag nodes). Use the same tag name in the builder and inef so conditions and scripts stay in sync.
ef.addTag(name, expirationMinutes)
Sets a tag (stored in a cookie). Use after a conversion, CTA click, or in a client script.- name — Tag name (same as in the Add tag node and Has tag condition).
- expirationMinutes — Optional. If omitted or
0, the tag is a session cookie (cleared when the browser closes). If set to a positive number, the tag expires after that many minutes (e.g.60= 1 hour,10080= 7 days).
ef.hasTag(name)
Returnstrue if the tag is set, false otherwise.
ef.removeTag(name)
Removes the tag (deletes the cookie).Flow control
ef.nextNode()
Only meaningful inside a Client script node. Advances the funnel to the next step. You can call it immediately or later (e.g. afteref.waitForVisible or ef.wait).
In the client script you write
ef.nextNode() with no arguments. The funnel engine replaces this with a call that knows the current node, so each script gets the correct “next” step.Visibility
ef.isVisible(selectorOrElement)
Returnstrue if the element exists and is visible (non-zero size, not display: none, not visibility: hidden, opacity > 0). Accepts a CSS selector string or a DOM element.
ef.waitForVisible(selector, callback)
Waits until an element matching the selector is in the DOM and visible, then runs the callback once. Works on refresh if the element is already visible. Returns a cancel function so you can stop waiting.Timing
ef.wait(ms, callback)
Runs the callback afterms milliseconds. Returns a cancel function (clears the timeout).
Client script examples
Wait for an element, then continue:Adding a tag from a click (no script)
Adddata-ef-add-tag="tagname" to a link or button (or to a parent component with data-cid). When the user clicks, the tag is set automatically. Useful for “clicked CTA” or “opened modal” without a client script.
Summary
| Method | Description |
|---|---|
ef.addTag(name, expirationMinutes?) | Set a tag. Omit or use 0 for session cookie; use a positive number for expiration in minutes. |
ef.hasTag(name) | Returns whether the tag is set. |
ef.removeTag(name) | Remove the tag. |
ef.nextNode() | Advance to the next step (use inside Client script). |
ef.isVisible(selectorOrElement) | Returns true if the element is visible. |
ef.waitForVisible(selector, callback) | Run callback when the element is visible; returns cancel. |
ef.wait(ms, callback) | Run callback after ms milliseconds; returns cancel. |