Adding Custom Data
User Identification
Section titled “User Identification”Set userId to track users across sessions and devices:
window.appziSettings = { userId: "user_abc123",};This enables:
- Response tracking across sessions
- “User is logged in” targeting rules
- Duplicate survey prevention
Lifecycle Targeting
Section titled “Lifecycle Targeting”Use userCreationDate to target surveys by account age:
window.appziSettings = { userId: currentUser.id, data: { userCreationDate: "2024-01-15", // ISO 8601 format },};This enables targeting like “show NPS to users older than 30 days”.
Settings Object
Section titled “Settings Object”You can customize certain Appzi behaviors using the global variable appziSettings.
The simplest way to define it is by adding a <script> tag in the <head> of your HTML:
<head> <!-- .... --> <script> window.appziSettings = { /// options }; </script></head>Adding additional data to feedback
Section titled “Adding additional data to feedback”To attach additional metadata to feedback submissions, use the 📖 FeedbackData property.
The feedback will use the label value (if provided) when displaying the field. If no label is given, the field name (key) will be used instead.
Example:
window.appziSettings = { data: { someText: "text", "camel-case-number": 5, booleanValue: false, labeledValue: { value: "test", label: "Some Test Label", }, },};Common Use Cases
Section titled “Common Use Cases”Track user context
Section titled “Track user context”Include user information to segment and analyze feedback:
window.appziSettings = { data: { userId: "user_12345", subscription: { value: "premium", label: "Subscription Plan", }, accountAge: "30 days", },};Debug issues
Section titled “Debug issues”Add technical context to help troubleshoot problems:
window.appziSettings = { data: { appVersion: "2.4.1", environment: "production", browserFeatures: { value: "webgl,websockets", label: "Browser Features", }, },};Dynamic data
Section titled “Dynamic data”Set data based on the current user state:
const user = getCurrentUser(); // Your function
window.appziSettings = { data: { userId: user.id, plan: user.subscriptionPlan, accountCreated: { value: user.createdAt, label: "Account Created", }, },};Privacy Considerations
Section titled “Privacy Considerations”Do not include:
- Passwords or authentication tokens
- Credit card numbers or payment information
- Social security numbers or national IDs
- Personal health information
Best practices:
- Only include data necessary for feedback context
- Use user IDs instead of names or emails when possible
- Ensure compliance with GDPR, CCPA, and privacy regulations
- Be transparent with users about what data you collect
Technical Limits
Section titled “Technical Limits”- Maximum fields: 50 fields per submission
- Maximum field size: 1000 characters per value
- Recommended total size: ~10KB or less
Keep data structures simple and include only information you’ll actually use for analysis.