EventProperties class to encapsulate this data with type safety.
Creating Properties
EventProperties wraps a dictionary with type validation. Invalid types throw an exception on construction.
Supported Types
EventProperties supports the following value types:
| Type | Swift | Objective-C | Example |
|---|---|---|---|
| String | String | NSString | "sports" |
| Integer | Int | NSNumber | 42 |
| Float | Float, Double | NSNumber | 3.14 |
| Boolean | Bool | NSNumber | true |
| Date | Date | NSDate | Date() |
| Nested Object | EventProperties | PermutiveEventProperties | See below |
| Array | [T] | NSArray | ["a", "b"] |
Nested Objects
Arrays
Event Enrichment
Events can be enriched with server-side data using special property values:Available Enrichment Values
| Value | Description |
|---|---|
EventProperties.geoInfoValue | Geographic location data |
EventProperties.ispInfoValue | ISP information |
EventProperties.ipHashInfoValue | Hashed IP address |
EventProperties.alchemyConceptsValue | Watson NLU concepts |
EventProperties.alchemyEntitiesValue | Watson NLU entities |
EventProperties.alchemyKeywordsValue | Watson NLU keywords |
EventProperties.alchemyTaxonomyValue | Watson NLU taxonomy |
EventProperties.alchemyDocumentEmotionValue | Watson document emotion |
EventProperties.alchemyDocumentSentimentValue | Watson document sentiment |
EventProperties.alchemyTaxonomyLabelsValue | Watson taxonomy labels |
EventProperties.alchemyEntityNamesValue | Watson entity names |
Location and ISP Enrichment
Watson Content Analysis (Standard Cohorts)
For Standard Cohorts support, include Watson taxonomy labels:Standard Cohorts Requirement: For Standard Cohorts to work, both a valid URL in the Context and the
classifications_watson.taxonomy_labels property must be set. Contact your Customer Success Manager (CSM) to enable this feature.Schema Validation
Common Schema Errors
Enable debug logging to see schema validation errors:Property Name Rules
Property names must follow these rules:- Only alphanumeric characters and underscores:
[a-zA-Z0-9_] - Cannot start with a number
- Case-sensitive
- Valid Names
- Invalid Names
Using Properties with PageTracker
Properties passed toPageTracker are included with automatically generated events:
Updating Properties Dynamically
For values that change during tracking, use the Objective-C style setter:Best Practices
- Do
- Don't
- Match property names and types exactly to your schema
- Use consistent property names across your app
- Use meaningful, descriptive property names
- Validate properties exist in your schema before deploying
- Use nested properties for complex structured data
- Test with debug logging enabled
Troubleshooting
Event rejected with schema error
Event rejected with schema error
Problem: Console shows schema validation errors.Solutions:
- Check property names match your dashboard schema exactly
- Verify property types are correct (string vs int vs bool)
- Remove any extra properties not in the schema
- Check for typos in property names
EventProperties init throws exception
EventProperties init throws exception
Problem: Creating EventProperties fails.Solutions:
- Verify all values are supported types
- Ensure no unsupported types like custom objects
- Check nested EventProperties are valid
Enrichment values not working
Enrichment values not working
Problem: Geo/ISP data not appearing.Solutions:
- Ensure your schema includes the enrichment property
- Contact support to verify enrichment is enabled
- Check you’re using the correct enrichment value constant