Targeting

User attributes

In this article, we explain PollHero user attributes and what you can do with them.

What are user attributes?

With user attributes, you can enrich information about your respondents and gain more insights about them in the analysis of your surveys. Additionally, user attributes enable more specific use cases, allowing surveys to be delivered even more precisely to customers.

How can user attributes be used?

The information you send to PollHero as user attributes via the Identify function can be used in targeting for survey delivery.

Furthermore, these user attributes are output in the CSV analysis as new columns (one column per user attribute with the corresponding value). You can find more on this in View reporting.

User attributes are transmitted via PH1.identify. The second argument is a flat object with key-value pairs. Standard fields (country, language, customer_type, total_revenue, etc.) are mapped directly to the corresponding profile attributes.

All other flat key-value pairs are stored as custom attributes.
Nested objects or arrays are not accepted.

If a user does not have an attribute, no targeting rule that requires a value for this attribute applies, not even a negated rule such as does not equal. Learn more in Onsite survey targeting.

Common use cases

Here are some use cases for how user attributes are typically used and what kind of content they are provided with.

Examples

A hotel chain wants to mark users in the checkout process who have not selected breakfast and later run an Onsite survey to find out why users opted against breakfast. They use the Identify method and send, for example, breakfast: false as a custom parameter. They can then use this as a targeting option for displaying their survey at a later time.

A pet food provider wants to display surveys on the order confirmation page to customers who do not have a subscription, specifically asking if they are aware of the subscription and/or why they decided against it. For this, an attribute active_subscriber: false is set after login, which is then used in targeting for survey delivery.

Standard attributes

Important: This list is just an example; you can set completely custom user attributes that are not listed here.

AttributeExampleRequirement
customer_typeprospect | lead | new | recurring | canceled–
total_revenue1230.12Must be a float
total_purchases8Must be a float
countryDEMust be ISO standard
languageDEMust be ISO standard

Setup code

You can easily embed the setup code via Google Tag Manager or directly in your source code to send custom attributes to PollHero.

(window.PH_API || (window.PH_API = [])).push(function() {
    var identifier = YOUR_IDENTIFIER || null; // Replace YOUR_IDENTIFIER with your own identifier (e.g., email or user ID), if available
    window.PH1.identify(identifier, {
        // Add your custom attributes here
        customer_type: "recurring",
        subscriber: true,
        subscription_date: '01.01.2025'
    });
});

Here is a concrete example where we set a correct identifier:

(window.PH_API || (window.PH_API = [])).push(function() {
    var identifier = 'info@poll-hero.com' || null;
    window.PH1.identify(identifier, {
        customer_type: "new",
        subscriber: true,
        subscription_date: '01.01.2025'
    });
});

On this page