General Targeting

Updated on 21. September 2026

For both onsite and embed surveys, you can use PollHero’s general targeting.

Here you can add rules for where and to whom your survey is displayed on your site, or whether embed surveys should be loaded.

If you don’t set a rule, the survey will be displayed on all pages as the default rule is Seiten-URL entspricht RegEx .*.

Page Targeting #

You can decide whether page targeting should follow an AND logic or an OR logic.

Overview of page targeting options

Page targeting can be applied to different pages:

Page URL: select specific URLs, such as a particular product, the order confirmation page, or a thank-you page.

Page language: target by page language if your website can be displayed in different languages.

Page hostname: You can target the survey by hostname,

Referrer domain: You can specifically include or exclude users who arrived via a particular referral (social, direct, ads, etc.) on a domain basis.

Referrer hostname: You can specifically include or exclude users who arrived via a particular referral (social, direct, ads, etc.) on a hostname basis.

SettingPollHero ReadsExpected Value / ExampleOperators
Page URLwindow.location.href, without trailing /Full URL, e.g., https://shop.example.com/products/shoe?color=redcontains, does not contain, equals, does not equal, RegEx
Page Languagedocument.documentElemen t.langThe exact value of , e.g., de or de-DEequals, does not equal, RegEx
Page Hostnamewindow.location.hostnameHostname without protocol and path, e.g., shop.example.comequals, does not equal, contains, does not contain, RegEx
Referrer Domainnew URL(document.referrer).hostnameHostname of the referrer URL, e.g., www.google.com; empty if no referrerequals, does not equal, contains, does not contain, RegEx
Referrer Hostnamedocument.referrerFull referrer URL, e.g., https://www.google.com/search?q=…; empty if no referrerequals, does not equal, contains, does not contain, RegEx

For pages, you have the following options:

contains: The URL contains certain slugs, so you can, for example, display the survey only on category pages. The survey will then be displayed on all pages that follow the format www.yourwebsite.com/category/, including www.yourwebsite.com/category/product1/.

does not contain: If you want to display the survey on most pages but not on all pages, you can enter the relevant slugs here. For example, you can exclude your About Us page, your privacy policy page, or your blog. Here too, all URLs that contain the slug will be excluded.

matches exactly: Enter a URL here on which you want to display the survey.

does not match: Enter a URL here on which you do not want to display the survey.

matches RegEx: The field expects a regular expression (RegEx).

Device #

Target users based on their device or screen width.

You can target Mobile, Desktop, Tablet, and SmartTV.

SettingPollHero ReadsExpected ValueOperators
Device TypeScreen width and User-AgentMobile, Tablet, Desktop, or SmartTVcontains, does not contain
Screen Widthwindow.innerWidthInteger in CSS pixels, e.g., 768>,

If no specific device type is selected, the survey will be loaded on all devices.

E-commerce #

Target based on different e-commerce features:

You can currently integrate PollHero with KLAR! and link your data that way.

E-commerce rules always evaluate the data of the identified user. For them to work, identify and the order must be assigned to the same PollHero User ID. Monetary values are processed as numbers with a dot as the decimal separator, for example 1249.99 (not 1.249,99).

Options in PollHeroField/OriginExpected ValueOperators
Total Number of PurchasesCustomer Metric total_purchasesNon-negative integer, e.g., 8equals, does not equal, >,
Total RevenueCustomer Metric total_revenueNumber, e.g., 1249.99>,
Average Order ValueCustomer Metric total_aovNumber, e.g., 156.25>,
Customer Typecustomer_type from identifynew or returningequals, does not equal
Order Item SKUsitems of an orderSKU/Item ID as string, e.g., SKU-456equals, does not equal, contains, does not contain
Item Brandsitems[].item_brandBrand name as string, e.g., Nikeequals, does not equal, contains, does not contain
Categoryitems[].categoryCategory name as string, e.g., Shoesequals, does not equal
Category 2–5 (limited)See note belowString, e.g., Menequals, does not equal
Coupon Codepurchase.coupon or items[].item_couponCode as string, e.g., WELCOME10equals, does not equal, contains

Note on Number of Orders (ordersCount): This option is currently not technically available in onsite targeting (always returns null in the frontend). For onsite targeting, always use Total Number of Purchases (total_purchases).

For ‘between’, exactly two numbers are entered as comma-separated lower and upper limits, e.g., 5,10 (without spaces). The limits are inclusive.

Important regarding ‘equals’ vs. ‘contains’ for items, brands, and coupons: PollHero internally aggregates SKUs, brands, coupons, and categories of all a customer’s orders into comma-separated lists (e.g., “SKU-1,SKU-2”). A rule with ‘equals’ checks for an exact match of the entire list and therefore only applies if the customer possesses exactly this one value in total. As soon as a customer has purchased multiple items, brands, or coupons, ‘equals’ will fail. For reliable matching of SKUs, brands, and coupons, the ‘contains’ operator should therefore always be used.

Limitation for Category 2 to 5: In the current client runtime, the evaluation for Category 2 to Category 5 checks the same value as for the main category (items[].category). Additionally, only the ‘equals’ operator is available for categories. If a customer has purchased items from multiple categories, ‘equals’ will fail.

Users #

In the “Users” section, you can specifically target certain users or user groups. You have access to the user’s country and language, as well as Custom Attributes.

Country #

PollHero currently does not validate the country code against a fixed list of countries, but compares the passed text. ISO Alpha-2 codes in uppercase are therefore the binding integration convention. Do not use Germany, DEU, or de if the rule is configured for DE.

Note on the ‘contains’ operator for country: Even if the operator is called ‘contains’ in the interface, PollHero internally checks whether the user’s country code contains the entered rule value. Therefore, only a single country code (e.g., DE) may be stored per rule – comma-separated lists like DE, AT will cause the rule not to apply.

SettingExpected FormatRecommended ValuesOperators
CountryString in countryISO-3166-1 Alpha-2 code in uppercase, e.g., DE, AT, CH, UScontains, does not contain

Language #

For user language targeting, exactly these five values are provided in the PollHero interface. Do not transmit regional codes like de-DE or en-GB for language; for example, ‘de’ must be sent for the user rule. This is independent of the page language, which is read directly from the lang attribute and can therefore also contain a regional code.

Custom Attributes are passed directly as flat properties in the second argument to PH1.identify (no nested object). ‘Equals’ and ‘does not equal’ compare the string value; ‘is set’ and ‘is not set’ check if the key exists in the profile.

SettingsExpected FormatAllowed ValuesOperators
LanguageLowercase language code in languagede, en, fr, es, itequals, does not equal
Custom AttributesAdditional flat key-value pairs in the attribute object, e.g., has_subscription: trueFor ‘equals’ / ‘does not equal’: attribute name and value (e.g., Key has_subscription, Value true); for ‘is set’ / ‘is not set’: only the attribute nameequals, does not equal, is set, is not set

Wie hilfreich war dieser Artikel?

  • Happy
  • Normal
  • Sad