In-Funnel API
Learn how to use fox API in your funnels to perform custom actions
FunnelFox provides fox
JS API to perform custom logic in your funnels. You can trigger this API with Raw elements like this:
<script>
fox.sandbox // returns true on preview funnels.
</script>
Parameters
Parameters allow to get useful information about the funnel.
fox.sandbox
: returnstrue
on preview funnelsfox.locale
: returns language code for user browser
Navigation
Navigation API allows you to perform custom navigation.
fox.navigation.goNext()
: triggers navigation action to the next indexed pagefox.navigation.goBack()
: triggers navigation action to the previously indexed pagefox.navigation.goToId('page-id')
: triggers navigation action to a page with specific custom IDfox.navigation.goIndex(1)
: triggers navigation action to a page with provided index
Inputs
Inputs API allows you to handle user replies and manually create them.
fox.inputs.get('input_id')
: returns value for provided input.fox.inputs.set('custom_input', 'custom_value')
: writes value to user replies. Does not require an existing input.fox.inputs.getEmail()
: returns value of Email input.fox.inputs.setEmail('email')
: writesemail
reply and binds email to user profile.fox.inputs.subscribeAll(callbackFunction)
: triggerscallbackFunction(key, value)
on every input change (user provided input, selected an option, etc.)
Integrations
Stripe
fox.stripe.setCustomerId('customer-id')
: forces Stripe Checkout to use provided customer. Checkout would not work if customer does not exist.
Custom User ID
By default we use FunnelFox profileID or email as user ID in all integrations (Adapty, RevenueCat, Mixpanel, etc.) You can change this ID to any value you like using special variable _USERID_
:
const yourCustomUserId = Math.random().toString();
fox.inputs.set('_USERID_', yourCustomUserId)
Tracking
The Tracking API allows you to send custom events to analytics systems.
fox.trackCustom(eventName, dataPayload)
Triggers a custom event with the specified event name and optional data payload.
- eventName (string, required) – The name of the event to track.
- dataPayload (object, optional) – Additional event data as key-value pairs.
Example:
fox.trackCustom('button_clicked', { buttonId: 'subscribe-button', location: 'footer' });
This example sends an event named "button_clicked"
with additional context about which button was clicked and where.
Updated 5 days ago