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.

  1. fox.sandbox: returns true on preview funnels
  2. fox.locale: returns language code for user browser

Navigation

Navigation API allows you to perform custom navigation.

  1. fox.navigation.goNext(): triggers navigation action to the next indexed page
  2. fox.navigation.goBack(): triggers navigation action to the previously indexed page
  3. fox.navigation.goToId('page-id'): triggers navigation action to a page with specific custom ID
  4. fox.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.

  1. fox.inputs.get('input_id'): returns value for provided input.
  2. fox.inputs.set('custom_input', 'custom_value'): writes value to user replies. Does not require an existing input.
  3. fox.inputs.getEmail(): returns value of Email input.
  4. fox.inputs.setEmail('email'): writes email reply and binds email to user profile.
  5. fox.inputs.subscribeAll(callbackFunction): triggers callbackFunction(key, value) on every input change (user provided input, selected an option, etc.)

Integrations

Stripe

  1. 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.

  1. 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.