hero.schedule('#form-id'), which listens for your form’s submit event and opens the scheduler automatically. But that doesn’t always fit. Maybe you’re running server-side validation before showing the calendar. Maybe your form lives inside an iframe. Maybe you’re building in React and there’s no traditional form submit event to listen to.
This article covers every way to invoke the RevenueHero scheduler on your website. For the step-by-step router setup that generates your script snippet, see Create Inbound Router.
BEFORE YOU BEGIN
- Create an Inbound Router and note your Router ID
- Add the RevenueHero source script to the
<head>of your page:
Methods
The RevenueHero script exposes three methods. The first,hero.schedule(), is the standard method documented in every web forms integration guide. The other two, hero.submit() and hero.dialog.open(), give you programmatic control over the entire flow.
hero.schedule(formSelector)
Binds to a form’s native submit event. When the form is submitted, RevenueHero intercepts the data, runs routing rules, and opens the scheduler automatically.e.preventDefault() on the form’s submit event before RevenueHero can listen to it, hero.schedule() will never fire. Use hero.submit() instead.
hero.submit(formData)
Sends form field data directly to RevenueHero for routing and qualification. Returns a Promise that resolves with session data you can use to open the scheduler.hero.schedule() doesn’t work.
hero.dialog.open(sessionData)
Opens the scheduler popup programmatically. Takes the session data returned fromhero.submit().
hero.submit(). This is what actually makes the calendar visible to your prospect.
Constructor options
TheRevenueHero constructor accepts a configuration object:
Custom validation before scheduling
The most common reason to usehero.submit() is when you need to validate form data before showing the scheduler. Run your validation, and only trigger RevenueHero if it passes.
Webflow forms (AJAX intercept)
Webflow forms submit via AJAX by default. If the standardhero.schedule() doesn’t trigger the scheduler on your Webflow site, use this jQuery-based intercept pattern:
#wf-form-Email-Form with your Webflow form’s CSS ID and 'xxx' with your Router ID.
For the standard Webflow installation that works without this intercept, see Webflow Forms.
React and Next.js
In single-page applications, the RevenueHero script needs to load dynamically since there’s no traditional page load.React
Next.js
Use the Next.jsScript component to load the RevenueHero script:
Gatsby
Gatsby uses the<Script> component from gatsby-script:
Google Tag Manager
You can load the RevenueHero script through GTM instead of adding it directly to your page HTML.Loading the script via GTM
- In Google Tag Manager, create a new Custom HTML tag
- Add the script:
- Set the trigger to DOM Ready on the pages where your form exists
- Publish the container
Tracking conversions with GTM
Use RevenueHero’s JavaScript Events to push conversion data into the GTM data layer:PAGE_LOADED event is particularly useful for Google Ads conversion tracking. It fires when the scheduler with booking slots is displayed, which means the lead passed your routing qualification. Use this as a “Qualified Lead” conversion action.
Global script across multiple pages
If you use the same form structure across many pages (e.g., the same HubSpot form on 400+ landing pages), you can install one script at the template level. Add the RevenueHero script to your site’s global template or theme footer. The script will look for the specified form selector on every page. If the form isn’t present on a particular page, the script does nothing.Re-trigger the scheduler (booking incomplete page)
If a prospect fills your form but doesn’t book a meeting, you can create a “Booking Incomplete” page that lets them try again. Store the form data inlocalStorage after the initial submission, then use hero.submit() on the retry page.
On your original form page
On the “booking incomplete” page
Troubleshooting
Scheduler doesn’t appear after form submit
Check the form selector. The CSS selector passed tohero.schedule() must match your form element exactly. Open your browser’s developer console and run document.querySelector('#your-form-id') to verify the form element exists.
Check for e.preventDefault(). If your JavaScript calls e.preventDefault() on the form’s submit event before RevenueHero’s listener fires, the scheduler won’t trigger. Switch to hero.submit() + hero.dialog.open().
Check the browser console. Look for errors from scheduler.min.js. A 500 error from the RevenueHero API usually means a field mapping mismatch. Verify that the field names in your form match the mappings in your Inbound Router.
Script not loading
Don’t defer the script. Addingdefer or async attributes to the scheduler.min.js script tag can cause it to load after your form’s submit handler runs. Load it synchronously in the <head> section.
scheduler.min.js from defer, delay, and minification settings.
Form inside an iframe
If your form renders inside an iframe (common with Pardot embedded forms), the parent page’s RevenueHero script cannot access the form’s submit event due to cross-origin restrictions. Solutions:- Use the Pardot integration which handles this natively with
formType: 'pardot' - Add the RevenueHero script inside the iframe’s HTML (in the form’s “Below Form” or “Thank You” content area)
- If neither works, contact support. The team can build a custom script for your form handler setup.
PHP or CMS wrapping the script in HTML tags
Some CMS platforms (WordPress visual editors, PHP templates) may wrap your<script> tag in <p> or <div> tags, which breaks execution. Use your CMS’s raw HTML or code block to prevent this.
Your advanced script installation is configured. Once you’ve added the script to your page, submit a test form entry and check your Routing Logs to confirm submissions are flowing through. 🎉🎉🎉
JavaScript Events
Listen for MEETING_BOOKED, PAGE_LOADED, and other events from the scheduler widget.
Create Inbound Router
Set up routing rules and get your Router ID.
Mapping Your Form
Map your form fields so RevenueHero can use them in routing conditions.
Custom HTML Forms
Standard script installation for custom HTML forms.