Creating surveys

Last updated:

|Edit this page

To create a new survey, go to the surveys tab in the PostHog app, and click on the "New survey" button in the top right. This presents you with a collection of survey templates or you can click "Create blank survey" in the top right to create your own.

Survey templates

After choosing one, you are brought to a form where you can complete the details of your new survey:

Create a survey

Here's a breakdown of each field in the form:

Presentation

There are three options for displaying a survey:

  1. Popover: Use PostHog's prebuilt user interfaces to show surveys as a popover in the bottom corner of the screen.

  2. API: Implement your own survey UI and use PostHog to handle display logic, capturing results, and analytics.

Steps

Steps is where you set up your question(s), label, choice(s), description, button text, and confirmation message. You must subscribe to surveys to add multiple questions.

You can also add conditional logic to display certain questions.

Tip: The description supports HTML, so you can do things like add images with an <img> tag.

PostHog supports multiple question types which are all available for both popover and API display modes.

TypePreview
Freeform textOpen text survey
Link/NotificationLink survey
Rating emojiEmoji rating survey
Rating - numberNumber rating survey
Single choice selectSingle choice select survey
Multiple choice selectMultiple choice survey

Customization

Customization enables you to change the look, feel, and timing of your popover survey:

  • The color of the background, border, and buttons.
  • The position of the popover at the bottom of the screen.
  • The placeholder text.
  • The visibility of the PostHog branding.
  • Whether to shuffle the order of the choices and questions.
  • The delay (in seconds) before the survey appears on the page.
  • Whether the confirmation message auto disappears after 5 seconds.
Delay survey customization

Display conditions

This specifies the conditions a user must meet to be shown the survey. A user must meet ALL the conditions to be eligible.

You can display your survey to specific users based on:

  • Linked feature flag: Whether a user has a specific feature flag enabled. For example, if you're rolling out a new landing page using a feature flag new-landing-page, you can gather feedback only from users who have that flag enabled. This is also a way to show surveys to cohorts (but it must be a non-behavioral one).

  • URL targeting: Show when URL either contains a string, exactly matches a string, matches a regex.

  • Selector matches: Whether a specific element exists or appears on the page with the specified class name or ID. For example, you can display a survey with #my-button or .my-button selector. This is useful for showing a survey after a user action.

  • Wait period: Hide surveys from users who have seen a survey in the last X days. Note that a user who completes a survey are never shown the same survey again, even if no wait period is set.

  • Person and group properties: If you are capturing identified events, you can display a survey to users who have specific person or group properties. For example, you can target a survey to users who have a property is_paying=true. This also includes a percentage rollout option.

  • User sends events: Display a survey to users who have sent a specific event during their session.

Display conditions

Completion conditions

This enables you to stop your survey once you receive a specific number of responses. Note that because it takes time for PostHog to process responses, this is a rough guideline. Your survey might receive slightly more responses than you set.

Launching your survey

Once you've set up your survey, click "Save as draft" to save your survey. This enables you to review any changes before launching. Then, when you're ready to launch, click the "Launch" button.

If you've created a popover survey, your survey will begin showing immediately to users matching your display conditions.

If you've created an API survey, you'll need to add your custom survey code before launching.

Questions?

  • Louise
    3 months ago

    Survey not showing

    I tried my first survey today. I did it in our DEV environment for testing. The display conditions are 'surveys will be displayed to everyone' and it was a simple popover with a NPS question. However, the survey is not popping up to users in our DEV environment. Where exactly should they be able to see it? I had assumed our main landing page?

    • Lucas
      5 days ago

      Hi Louise! Can you fire a bug report here?

      Also, did you launch your survey? If it's on draft mode, it'll not be shown

  • Jon
    3 months ago

    Is there a way to duplicate a previous survey or use one as a template?

    I wanted to adjust my survey after launching it and I noticed it was not editable at that point. This is good because you don't want to have bogus results. But I don't see a way to create a new survey based on the previous survey, so I think I need to redo it from scratch. That makes it possible for me to introduce a whole new mistake! Could there be a way to copy a survey or have a template?

    • Jon
      Author3 months ago

      Oh. The AI response is private, but my reply to it is public? I'm very confused.

  • Dan
    4 months ago

    Multivariate feature flag

    Hi, I see that there is a option to link a feature flag but what if you only want to show a survey on a specific variation of the feature flag? The use case if that I want to gather more qualitative information on a specific feature in an A/B test.

    Thanks! Dan

  • Jorien
    5 months ago

    Dynamic terms based on user properties

    Is it possible to use dynamic terms based on user properties in the label (the question) for a step?

  • Jorien
    5 months ago

    Max. surveys shown a day

    Is it possible to set a maximum per day for a survey to be shown?

    • Jorien
      Author5 months ago

      Ah yes clear! Thanks for the answers.

  • Jorien
    5 months ago

    URL targeting

    Is it possible to add multiple URL that the survey should not show on? So URL doesn't contain URL1 + URL2 + URL 3 etc.?

    • Phani(he/him)
      5 months ago

      Hi Jorien,

      You can use the does'nt match regex condition to restrict targeting your survey on some URLs. image.png

      Thanks,

      Phani

    • Jorien
      Author5 months ago

      Thanks! That helps a lot.

  • Alex
    5 months ago

    Adding more than 6 options to a single/multiple choice question

    We want to be able to have single/multiple choice questions in our api (not popover) survey, with more than 6 options. But there appears to be no way to do this in the PostHog UI.

    The only workaround we can find is to create the entire survey and all of its questions through the PostHog API. But this is not a marketer-friendly approach - it's only easy for a developer to modify the survey with this approach, even though the questions will be managed by the marketing team.

    It would be nice if the UI allowed creating more than 6 answers - perhaps with a warning saying it won't look good in a popover survey.

  • Shawn
    5 months ago

    Display conditions not updating

    Hi there, I'm trying to use the "User sends events" Display Condition in a survey, but not matter what event I select, when I save the survey. the Display conditions summary still says "Surveys will be displayed to everyone." and then the survey displays immediately to all users.

  • Shubhangi
    6 months ago

    Dynamic links with user properties in survey

    Can I create dynamic links in surveys through existing user properties?

  • tosi
    6 months ago

    What is the max delay

    https://posthog.com/docs/surveys/creating-surveys#customization I tried 120 seconds and it does not show up. It should show up even if the user navigate to other sub-pages, right?

    • Michael
      6 months ago

      Hi Tosi,

      I dont think there is a max delay. I was able to put 1000 seconds. Surveys will only popup if all the display conditions were met. I would double check the display conditions to make sure things are in order.

    • Michael
      6 months ago

      Hi Tosi,

      I dont think there is a max delay. Looks like I was able to input 1000 seconds. In order for survey to popup all the display conditions have to be met. I would double check the display conditions to make sure things are in order.

  • antonio
    6 months ago

    Survey schedule

    Hi,

    I'm not sure about how the "How often should we show this survey" conditions work.

    • If we select "once", does it mean if the user closes the survey they won't see it again? Wether they completed it or not?
    • Regarding the "repeat X times, once every X days", will it keep repeating even if the survey has been completed or just for uncompleted ones?
    • If it repeats only when it hasn't been completed, if we set it to repeat 3 times, once every 3 days, does it mean that for example they'd see the survey only 3 times in total, one on Monday, one on Wednesday and one on Friday?

    Thanks

  • Santiago
    6 months ago

    Upcoming Feature Releases for Survey Triggering and Filtering

    I would like to know if you have plans to launch these three features in the short term:

    1. Triggering surveys based on actions, not just events. Currently, only events can be used as triggers, but not actions. When do you think actions will be usable as triggers?
    2. Triggering surveys with events that have filters (i.e., a specific event with a particular property of the event). This is not possible today; when do you think it will be possible?
    3. Filtering with cohorts that have actions within their filters (when using these cohorts, the system denies the ability to filter this way). Do you think it will be possible to use cohorts containing actions to filter surveys? Thank you very much in advance!
    • Steven(he/him)
      6 months ago

      Hey Santiago,

      Regarding items 1 and 2, we don't have an exact ETA, but quoting from notes for the current sprint:

      "event based triggers with actions and filters ... - action based filters are ready, tests in progress!"

      Regarding behavioral cohorts (event-based and action-based cohorts): Feature flags require fast evaluation, but behavioral queries are relatively slow. So, enabling these queries would significantly impact the performance of feature flags.

      A workaround is to create a dynamic behavioral cohort and then duplicate it as a static cohort (using the button on the top right of the cohort page):

      CleanShot 2024-07-16 at 10.05.01@2x.png

    • Santiago
      Author6 months ago

      perfect, thanks for the response!

  • Santiago
    6 months ago

    Surveys wait period

    The first question here is the wait period: "Wait period: Hide surveys from users who have seen a survey in the last X days. Note that a user who completes a survey are never shown the same survey again, even if no wait period is set."

    I set a survey wait period to be 3 days and im seeing the survey is being shown to the same person everyday. how is this possible?

    on the other hand, when you say: "Note that a user who completes a survey are never shown the same survey again, even if no wait period is set." What is the definition of complete? that the survey was sent? That the person actually sent and answer?

    thanks!

    Santiago

    • Steven(he/him)
      6 months agoSolution

      Could you please open a support ticket for this by using the 'Help' tab in the righthand sidebar while you're logged in? That'll include additional info about your account and configs that will help us to troubleshoot.

      When opening that ticket, please also let us know which survey (if you have more than one) and please also identify for us an example user who has seen the same survey everyday? Thanks!

      Regarding the definition of "complete" in the context of surveys, is when the user has completed the survey and submitted their response to the last item in the survey.

  • Santiago
    7 months ago

    Can I do an A/B test with diferent surveys? If so, how do I do it?

    Trying to do and A/B test to analise which is the best way to ask something to a group of people in a particular moment (particular URL)

  • Adam
    7 months ago

    Show the survey again to all users

    Hello, Is it possible to show the survey again to users who have already responded? We would like to display the feedback form every time they complete some process (e.g. completing an order). Thanks, Adam

    • Ehab
      4 months ago

      will setting repeatedActivation to true do the trick?

  • Dov
    7 months ago

    Can I require a survey response?

    Can I require that the user answer a survey (cannot dismiss)?

  • Lilian
    9 months ago

    Survey cohorts not matching criteria

    I want to run at the same timeframe:

    1. Survey 1 for Group 1 matching criteria (created as a static cohort) and 2) Survey 2 for Group 2 (everyone else who is not in Group1).

    I don't see in the UI how to set up for Group 2. Creation of cohort or survey target has matching (all/any) criteria. How do I achieve a set up to survey Group 2?

    • Lilian
      Author9 months ago

      Oh! I'll test the behavioral property on the cohort creation.

    • Ian
      9 months agoSolution

      You should be able to create a cohort with the filter for not being in another cohort too:

      CleanShot 2024-05-02 at 17.08.08@2x.png

  • Younes
    a year ago

    Ability to configure delayed survey automatically without code

    We need this one and it's an basic one for enterprise SaaS: we should be able to configure delayed survey automatically without code, based on the user creation date. I don't want to do something like this with a custom code (https://posthog.com/tutorials/delayed-survey). Posthog should handle this automatically since you guys have user data.

    Thanks

    • Neil
      a year ago

      Hey Younes, indeed, this will be possible in the future, just not yet.

      Although, this tutorial is only for small client side delays. If you want to delay surveys by days / weeks, you can do so without code by targeting users via your survey release condition

    • Younes
      Authora year ago

      There is an issue there, posthog does not give me access to user creation date in posthog. I don't want to push this property from the code. Posthog should have it automatically.

  • Younes
    a year ago

    Seems like a basic one. Ability to show a survey based on user creation date in posthog.

    Seems like a basic one: Ability to show a survey based on user creation date in posthog.

    I don't want to implement a custom class to trigger the survey, we don't want to handle that logic. Posthog should handle this, since you guys have the user data.

    • Jorien
      5 months ago

      Interested in the answer for this.

    • Igor
      2 months ago

      Kinda frustrating no one from the team responded on this yet!

  • Alex
    a year ago

    Logic

    Is survey logic going to be added at some point? I.e - rate this experience from 1-5 If less than 3, ask another question Cheers,

    • Neil
      a year agoSolution

      Hi Alex, it's on our roadmap but I'm afraid not anytime soon. You can follow this issue for updates: https://github.com/PostHog/posthog/issues/19516

    • Brian
      7 months ago

      We would also like to have this feature.

      For example on an NPS, I may want to use different language depending on the rating I receive.

      • Detractors: Sorry to hear about your experience can you tell us more about your score?
      • Neutrals: Anything we can do to improve to make this a 10?
      • Promoters: Thanks! Anything we can do to make your experience better?

Was this page useful?

Next article

Implementing custom surveys

At its most basic level, a survey is a collection of response events. If you wanted to, you could capture events from anywhere, like in this example of a hardcoded Next.js feedback survey: The benefit of using PostHog beyond this is that it handles: Survey content. Customize question type, text, and more. Change it at runtime without needing to redeploy your app. Display conditions. This means not showing the same survey multiple times, the wrong survey, or a survey that has collected enough…

Read next article

PostHog.com doesn't use third party cookies - only a single in-house cookie.

No data is sent to a third party.

Ursula von der Leyen, President of the European Commission