Conditional logic enables you to create dynamic, personalized experiences that adapt based on user properties and survey responses. Use conditional logic to branch survey paths, trigger different actions based on user characteristics, or show different content to different users.
Conditional logic can be used with both guides and surveys and can be chosen as an action for either primary or secondary buttons.
Create conditions based on two types of data:
User properties are attributes about your users, such as their location, subscription tier, or account type. User properties must be shared client-side during the session with either the Amplitude SDK or the Engagement SDK.
Common user property examples:
subscription_tiercountryaccount_typeinitial_referring_domain
Survey responses are the answers users provide to questions in your surveys. Use survey responses to branch your survey based on how users answer.
Survey response examples:
You can combine multiple conditions to create more sophisticated logic. When you add multiple conditions, all conditions must be met for the action to execute.
For example, you might create a condition that says: "If subscription_tier = premium AND country = US, then visit link to premium US-specific content."
The setup process is similar whether you're adding conditional logic to buttons or survey steps.
Create a survey that asks different follow-up questions based on a user's NPS score:
rating ≤ 6 (Detractors), then go to step asking "What can we improve?"rating ≥ 9 (Promoters), then go to step saying "Thank you! Would you leave us a review?"This ensures detractors get a chance to provide feedback, while promoters are encouraged to share their positive experience.
Create a guide with a button that directs users to different pages based on their subscription level:
subscription_tier = premium, then visit link www.example.com/premium-features.subscription_tier = free, then visit link www.example.com/upgrade.This ensures each user sees content relevant to their subscription level.
Launch a secondary guide based on both user property and survey response:
country = US AND rating > 8, then show guide "US-specific-offer".country ≠ US AND rating > 8, then show guide "international-offer".This creates a personalized experience based on both location and satisfaction level.
Create a button action that clicks different elements based on user characteristics:
user_type = new, then click element [data-testid="onboarding-flow"].user_type = returning, then click element [data-testid="dashboard"].This ensures new users enter onboarding while returning users go directly to their dashboard.
November 7th, 2024
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2025 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.