Skip to main content
Your customers are already logged in to your product, so you know who they are. The RevenueHero scheduler can open right inside your app, take the user’s details from your app instead of a form, and route them to the right person: their account owner, support, an expert on the page they’re stuck on, or anyone else your rules pick. This page shows you how to set up a router for it and add the code to your app.

Use cases

Any time a logged-in user needs to talk to someone on your team, you can offer a meeting from inside the app:
  • Upgrades. A user on a smaller plan clicks a feature their plan doesn’t include and books time with sales.
  • Renewals. A customer near renewal books with their account manager.
  • Support and help. A user stuck on a settings page books with the person who knows that part of your product.
  • Account requests. Anything else a customer would otherwise email about.
The user never types their name or email, because your app sends them in the background.

How the in-app scheduler works

The in-app scheduler uses the same RevenueHero script and Inbound Router as the scheduler on your website. The difference is where the data comes from. On a website, a visitor fills in a form. Inside your app, your code sends the logged-in user’s details to RevenueHero when they click a button or link.
  1. The user clicks a button or link in your app, such as Talk to us.
  2. Your code calls hero.submit() with the user’s details from your app.
  3. RevenueHero runs the router’s rules and picks the rep.
  4. Your code calls hero.dialog.open(), and the scheduler opens on top of your app.
This works anywhere your app can run JavaScript.

Set up the in-app scheduler

BEFORE YOU BEGINYou need a Meeting Type and a Team for the router to book into.
1

Create a new Inbound Router

In the left sidebar, click Inbound, then Routers, then Create Inbound Router, and click Get Started.Create a new router for your app instead of reusing the one on your website. In-app requests are a different job from website demo requests, so a separate router keeps your website routing unchanged, lets you write rules for help and account requests, and keeps in-app submissions apart in Routing Logs. People in an app also often open the scheduler without booking, so a separate router keeps those visits out of your website reports.The steps below guide you through setting up this router for in-app bookings.
2

Map a new form for your app

On Map a form, don’t pick your website form. Click Create Form, then I’ll do this manually.
Create Form Mapping panel with Form Name, Webpage url and Form Selector fields
  • Form Name. A name you’ll recognise, such as In-app help.
  • Webpage url where your form is present. Leave it empty. Your app has no form page.
  • Form Selector. This field is required to save the form mapping, but it isn’t used for in-app bookings. Enter any placeholder, such as #in-app-help.
Then map the fields your code will send:
Map Email and Map Name sections with Form field name inputs and HubSpot contact fields
  • Email and Name are required. In Form field name, type the key your code will send for each, for example email and firstname.
  • Map Additional Form Inputs is only needed for fields a routing rule uses, such as plan or region. Your app already knows who the user is, so you rarely need more.
The form field names must match the keys in your code exactly, including capital letters: Email and email are different keys. If you map email, your code sends email: user.email. Save the form mapping.
3

Set the routing rules

Decide who should take these meetings:
  • Matching rules. Most of your users are customers who already have an owner in your CRM, and it’s usually best that they talk to that person. A matching rule books them with their existing owner. If you don’t want owners to take these meetings, leave matching rules off.
  • Distribution rules. These decide who gets the meeting when there is no owner match. You can route by region, team, or where in your app the user asked for help.
Distribution rules list with three rules: In-app SEs, In-app US and in-app Non US

An in-app router with distribution rules for Solutions Engineers, US users and non-US users.

To route by page in a web app, add a condition on Enrichment > Source URL, which is the page the user was on when they clicked. For example, Source URL contains routing-logs sends users who ask for help from your routing logs page to the team that knows it best.
Distribution rule condition: Enrichment Source URL contains routing-logs
You can also route on details your app sends. Your app already knows things like the user’s plan or the part of the product they’re using. Map that key under Map Additional Form Inputs to the matching CRM property, send it in hero.submit(), for example product_area: "billing", and add a condition on it from Form Inputs in a distribution rule. In a native mobile app, Source URL isn’t available, so send a field like this to tell your rules where the user came from.
4

Configure the router

On Configure Router, pick the meeting type and duration, for example a 15 minute help call. A post-booking form is usually not needed, because you already know who the user is.Name the router, for example In-app help router, and create it.
5

Copy the in-app snippet

Open your router and click Widget Installation. On the Website tab, under Show the scheduler, select Inside your application. The snippet includes your Router ID.
Widget Installation with Inside your application selected and the router snippet shown
The snippet has two placeholders to replace: #buttonId with the element your users click, and field: "value" with the fields from your form mapping.
6

Add the code to your app

Add the RevenueHero script once, in the <head> of your app, before any code that uses it.
For a version-locked tag with Subresource Integrity, generate one on Installation Methods.Then call the scheduler from whatever the user clicks. The example below uses a button, but any link, menu item or custom event works.
To show a loading spinner while the rules run, add showLoader: true next to routerId. Every option is listed under Constructor options.
If your account lists any Trusted Origins in its security settings, add your app’s domain to that list, for example https://app.yourcompany.com. Once at least one origin is listed, submissions from any other domain are blocked, so the scheduler won’t open inside your app until its domain is added.
7

Test it

Log in to your app as a test user, click the button, and book a slot. Then open Routing Logs, filter by your in-app router, and check that the submission went to the rep you expected.If a rule checks Source URL, test from the page in your app that the rule expects. A test from any other page, such as a local test page, won’t match that rule and may be routed or disqualified differently.

Tips for in-app setups

The router runs every time hero.submit() is called. If your app calls it as soon as a screen opens, every user who opens that screen goes through routing and shows up in Routing Logs, whether or not they wanted a meeting. Users who qualify but don’t book are also sent to your CRM with the meeting status Not booked, so everyone who opened that screen would be marked that way. Call it when the user clicks.
Make sure one click calls hero.submit() once. If a click fires the handler more than once, which can happen in mobile apps, Routing Logs show duplicate submissions a few seconds apart.
If hero.submit() fails with a 422 error and this message, RevenueHero didn’t find the email in what your code sent. Check that the key matches the Form field name in your form mapping exactly, including capital letters, and that the snippet’s field: "value" placeholder has been replaced with your real fields.
If people sign in to your app with personal addresses, such as Gmail, check that the router’s Disqualification Settings allow free emails. Otherwise those users are disqualified and never see the scheduler.
A brand-new user may not have a CRM record when they click. Matching rules then find no owner, and the user goes to your distribution rules instead. Make sure at least one distribution rule catches them.
If an additional field is empty for some users, such as a phone number you only collect in some countries, leave it out of hero.submit(). Routing still runs. It fails only if the email is missing or doesn’t match your form mapping, or if a rule uses a field that isn’t in your form mapping.
Your app only holds the Router ID. The rules live in RevenueHero, so you can change who gets which meetings at any time without shipping a new version of your app.

Your customers can now book the right person without leaving your product. 🎉

Installation Methods

Every way to call the scheduler, including hero.submit(), hero.dialog.open() and React examples.

Create an Inbound Router

Every step of router setup in detail.

What are Matching Rules?

How a matching rule books a customer with the rep who already owns their account.

Routing Logs

Check where each in-app submission went and why.