UserHero Docs
Widget Builder

Widget Targeting

Control where and when your feedback widget appears

Widget Targeting

Targeting rules let you control exactly where your widget appears. Show it on specific pages, hide it on others, or target specific devices.

Page Targeting

Show on All Pages

The simplest option—your widget appears everywhere on your site.

✅ Show on all pages

Include Specific Paths

Only show the widget on certain pages:

Include paths:
• /dashboard/*
• /app/*
• /pricing

Pattern matching:

  • * matches any characters (e.g., /blog/* matches /blog/post-1, /blog/category/tech)
  • ? matches a single character
  • Exact paths match exactly (e.g., /pricing only matches /pricing)

Exclude Paths

Show everywhere except specific pages:

✅ Show on all pages
Exclude paths:
• /checkout/*
• /login
• /signup

Common exclusions:

  • Authentication pages (/login, /signup, /forgot-password)
  • Checkout flows (/checkout/*, /payment/*)
  • Print pages (/print/*)
  • Admin areas (/admin/*)

Device Targeting

Control which devices see the widget:

DeviceDescription
DesktopLaptops and desktop computers
TabletiPad, Android tablets
MobileSmartphones

Examples:

  • Show only on desktop (disable for mobile/tablet)
  • Show only on mobile (for mobile-specific feedback)
  • Show on all devices (default)

Tip: Mobile users may have different feedback needs. Consider creating separate widgets with tailored templates for mobile vs. desktop.

Path Pattern Examples

Blog Section

Include: /blog/*

Matches: /blog, /blog/post-1, /blog/category/tech

Specific Feature

Include: /app/feature-*

Matches: /app/feature-dashboard, /app/feature-reports

Everything Except Auth

Show on all pages: ✅
Exclude:
• /login
• /signup
• /forgot-password
• /reset-password

Only Logged-in Areas

Include:
• /dashboard/*
• /settings/*
• /account/*

Product Pages Only

Include:
• /products/*
• /product/*

Multiple Widgets Strategy

You can create multiple widgets with different targeting rules:

Example setup:

  1. General Feedback Widget

    • Template: Floating
    • Show on all pages
    • Exclude: /checkout/*, /login, /signup
  2. Bug Report Widget

    • Template: Bug Report
    • Include: /app/*, /dashboard/*
    • Desktop only
  3. Mobile Feedback Widget

    • Template: Rating
    • Mobile only
    • Show on all pages

Testing Targeting Rules

After setting up targeting:

  1. Save your widget configuration
  2. Visit different pages on your site
  3. Verify the widget appears/hides as expected
  4. Test on different devices or use browser DevTools device emulation

Troubleshooting

Widget not showing?

  • Check if the current path matches your include patterns
  • Verify it's not in an exclude pattern
  • Confirm device type matches targeting settings
  • Check browser console for errors

Widget showing unexpectedly?

  • Review your exclude patterns
  • Ensure pattern syntax is correct (* for wildcards)
  • Check if another widget has broader targeting

Next Steps

On this page