Userflow on mobile websites

Prev Next

Userflow works on mobile websites and web apps. Flows, checklists, banners and the Resource Center are responsive, so they fit smaller screens without extra work. For native mobile apps built with React Native, use the Userflow React Native SDK instead.

You only need to do more on mobile web when:

  • you want the Checklist or Resource Center launcher to be smaller on phones, or

  • your mobile site has a different layout from your desktop site, so a flow's tooltips need to point at different elements.

How does Userflow know a user is on mobile?

Send a device_type attribute from your app in userflow.identify(). For example:

userflow.identify(userId, {
  //...
  device_type: window.innerWidth > 800 ? 'desktop' : 'mobile'
})

The attribute is mobile for users on a narrow screen and desktop for everyone else. Use it in theme variations and flow conditions, as described in the next two sections. Attributes are covered in Standard Attributes.

Make launchers smaller on mobile

The checklist and Resource Center launchers can feel large on a phone. You don't need separate checklists or Resource Centers to change that; use a conditional variation on your theme instead.

  1. Go to Settings > Themes and open your main theme.

  2. Add a conditional variation that uses the device_type attribute.
    Theme variation with a device type condition

  3. In the variation, change the size of the checklist and Resource Center launchers, then save the theme.

Userflow applies the variation automatically for users whose device_type is mobile. See Customizing Themes.

Separate flows for mobile and desktop

If your mobile layout is very different, build one flow (or checklist) for mobile and one for desktop, each pointing at the right elements.

  1. Create the two flows. The quickest way is to duplicate the existing flow.
    Duplicating a flow in the flow list

  2. In each flow's auto-start conditions, add a device_type condition so it only starts on its device type, and is hidden on the other.
    Auto-start condition on the device_type attribute

  3. So a user doesn't see both, add a condition to each flow that it only starts if the other flow hasn't been seen.
    Condition that the desktop flow has not been seen

How do I preview a flow on my mobile website?

Preview always starts the flow, even if the test user doesn't match its auto-start conditions, so you can preview a mobile-only flow from a desktop browser.

  1. Open the mobile flow in the builder and click Preview. Userflow opens your app in a new tab.

  2. In that tab, open Chrome DevTools (F12) and turn on the device toolbar (Ctrl+Shift+M, or Cmd+Shift+M on Mac).

  3. Pick a phone size from the toolbar's device list. Your site switches to its mobile layout.

  4. Reload the page if your site only switches layout on load, then step through the flow.

To check what a real user on a phone sees, publish the flow to a test environment and open your site on the phone while signed in as a test user. See Setting up environments and versions.

Can I turn Userflow off on mobile?

Yes. Don't load the Userflow.js snippet on your mobile site. Users on mobile then aren't registered and see no Userflow content. See Userflow.js Installation.