Schema
Overview
Schema is a framework to maintain your data, organize, and structure it. It enforces rules to maintain data integrity so that you can avoid data quality issues later. Schema standardizes your data before you even begin using it. Since bad data leads to a high cost in effort and money, you can save a lot of manual effort on tracking your data in the long run.
To preserve data sanity, the schema table stores event and user properties in a pre-defined order. It ensures better output because it enforces standardization of the incoming data and avoids duplication or corruption of data. Better input leads to a better outcome in your campaigns and journeys. It also provides more accurate insights into your data analytics.
Events
You can see your events under Settings > Schema Events. On this page, you can view all the events you are working with, along with editing or discarding to searching and filtering them.
The Events schema has four parts:
Custom Events
Custom events are events that you can define, edit, remove, and so on. These are your app events that you can fully control.
- Navigate to Settings > Schema > Events.
- Click the Custom events tab.
If you have already defined your events, they are all present on this tab.
Event Detail | Description |
---|---|
Event name | The name of the event as it is displayed on the dashboard. |
Type | There are two types: Defined: Events that are part of your schema definition. Undefined: Events that are not defined in the schema but passed to CleverTap. |
Status | An event can have any of the following statuses: Active: An event that has been passed to CleverTap. Inactive: An event that has not yet been passed to CleverTap. * Discarded: An event for which all past data has been dropped. Any future data that is passed for the event with the same name will also be dropped. |
DRP | Data retention policy defines the length of time that the data is retained. |
This month | The number of occurrences of the event in the current month. |
Last month | The number of occurrences of the event in the previous month. |
Count | A count can be an event, event property, or a user property update. |
Properties | Attributes that provide additional context around the event. For more information, refer to Event Property. |
Add Event
You can add an event from the Custom events tab.
- Navigate to Settings > Schema Events > Custom events.
- Click the +Event button to add an event.
- Add the event name. This name must be unique in the schema.
For more information, refer to Event Property.
Edit Event
The name cannot be changed after the event is published.
- Click the edit icon on the event row.
- Edit the event name.
- Click the checkmark.
Set Data Retention Policy
The data retention policy (DRP) retains an event for the specified time before discarding it automatically. Your subscription plan will decide the default DRP limit.
- Navigate to Settings > Schema > Events.
- From the System Events tab, click the ellipsis on the event row and click Set DRP.
- Select Custom, then enter your specific time limit.
CleverTap for Startups Limit
The default DRP for CleverTap for Startups users is one year and this cannot be changed.
- Click Save.
Remove Event
You must be careful before removing an event. If you ever need to remove an event from the schema, remove it from the event row on the Events page. You can only remove an inactive event from your schema; however, the effects are minimal because the event is not active. This action does not drop another event coming in with the same name.
- Click the ellipsis menu on the event row.
- Click Remove.
After an event is removed:
- The entire event row is removed from the schema.
- If an event comes in with the same name, it is considered an undefined event.
Discard Event
You can discard an active event from the schema. You can still see the event row in the schema; however, it will be marked as discarded.
Caution When Discarding an Event
You can only discard an active event. Exercise extreme caution when discarding an event because this action cannot be undone. This action has an impact on your schema because it purges all data for the discarded event. It also drops any future incoming event with the same name.
- Click the ellipsis menu on the event row.
- Click Discard.
Define Event
The events that are passed to CleverTap but not defined are marked as undefined events. You can define these events from the event row. Defining an event marks it as a recognized event in the schema, and therefore, when the event is received, this will not cause any error.
- Click the ellipsis menu on the event row.
- Select Define Event, and a new window displays.
- Click Define & Save.
Publish Schema/Events
To publish the events, perform the following:
- Check that you have all the required events.
- Click the Publish Events button.
All the new events flowing in will be validated against the new rules set. You will get a confirmation email.
Handle Undefined Data
You can handle all the undefined events simultaneously.
- Click the ellipsis menu on the right of +Event.
- Select Handle undefined data. The Undefined data settings page displays.
- Make your selections, then click Save.
If an undefined event occurs:
- Allow event: The event can start recording data, even if it is not defined in the schema.
- Drop event: If the event is not defined in the schema, then it is dropped.
Caution
Exercise this option with caution. This is a powerful option to keep your data clean, but you may lose unexpected data. This action cannot be undone.
If an undefined event property occurs:
This option is only applicable to defined events that have undefined event properties.
- Drop event: The event is dropped along with the event property.
Caution
Exercise this option with caution. If a defined event records an undefined event property, then the entire event is dropped. This is a powerful option to keep your data clean, but you could drop an existing event if it starts receiving an undefined property.
- Drop event property: Only the event property is dropped but the event is allowed.
- Allow event property: The event property is allowed to start recording data.
Error Note
An error is reported for all actions. A drop will have a higher severity, and allow will have a lower severity. For more information, refer to Error Stream.
Event Property
This section shows how to manage your event properties.
- Navigate to Settings > Schema > Events.
- Click the Custom events tab. All the events are listed on this page.
- Click any of the properties on the event row to see the property details.
Property Detail | Description |
---|---|
Property name | The name of the property. |
Type | The type of property: Defined: Properties that you have added to the schema. Undefined: Properties that you have not added to the schema and are currently receiving data. |
Status | An event property can have any of the following statuses: Active: An event property that has been passed to CleverTap. Inactive: An event property that has not yet been passed to CleverTap. * Discarded: An event property for which all past data has been dropped. Any future data passed for this user property with the same name will also be dropped. |
Required | This defines whether a property is mandatory for the event. Yes: The property is mandatory. The event is dropped if it is received without the event property. Note: Exercise this option with caution. If an event is received without the required property, then the entire event is dropped. This is a powerful option to keep your data clean, but you could drop an existing event if it starts receiving an undefined property. No: The property is optional. The event is allowed even if it is received without the event property. |
Data type | This defines the data type of the event property: String Integer Float Boolean Mixed List |
Data type fallback | The fallback action if the event property is not in the defined format: Drop event: This drops the incoming event if the data type does not match. Note: Exercise extreme caution when dropping an event. This action cannot be undone. This action has an impact on your schema because it purges all data for the dropped event. It also drops any future incoming event with the same name. Drop event property: This drops the incoming event property if the data type does not match. Note: Exercise extreme caution when dropping an event property. This action cannot be undone. This action has an impact on your schema because it purges all data for the dropped event property. It also drops any future incoming event property with the same name. Allow property: This allows the property even if the data type does not match. An error is reported for all actions. A drop will have a higher severity, and allow* will have a lower severity. For more information, refer to Error Stream. |
Created on | The date when the user property was created. |
Description | The description of the event property. You can set the description from the ellipsis menu on the event property row. |
Add Event Property
To add an event property:
- Click the +Property button from the Custom events tab, then click Add new.
- Enter a property name and choose the relevant property details.
- Click the checkmark.
Edit Event Property
You can edit any column; however, you can only edit names for unpublished event properties.
- Click the edit icon on the property row from the Custom events tab.
- Edit the property name and any other appropriate property details.
- Click the checkmark.
Remove Event Property
You can remove an unpublished event property.
- Click the ellipsis icon on the property row from the Custom events tab.
- Click Remove.
After an event property is removed:
- The entire event property row is removed from the schema.
- If an event property comes in with the same name, it is considered undefined.
Discard Event Property
You can discard a published event property from the schema. You can still see the event property row in the schema; however, it will be marked as discarded.
- Click the ellipsis icon on the property row from the Custom events tab.
- Click Discard, and a new window displays.
- Click Discard again.
Caution When Discarding an Event Property
Exercise extreme caution when discarding an event property. This action cannot be undone. This action has an impact on your schema because it purges all data for the discarded event property. It also drops any future incoming event property with the same name.
User Properties
This section shows how to manage your user properties.
- Navigate to Settings > Schema > User Properties. All the user properties are listed on this page.
- Click any of the properties on the user property row to see the property details.
From this page, you can also search and filter properties.
Property Detail | Description |
---|---|
Property name | The name of the user property. |
Type | The type of property: Defined: Properties that you have added to the schema. Undefined: Properties that you have not added to the schema and are currently receiving data. |
Status | A user property can have any of the following statuses: Active: A user property that has been passed to CleverTap. Inactive: A user property that has not yet been passed to CleverTap. * Discarded: A user property for which all past data has been dropped. Any future data that is passed for this user property with the same name will also be dropped. |
Data type | This defines the data type of the user property: String Integer Float Boolean Mixed List |
Data type fallback | This includes: Drop user property: This drops the incoming property if the data type does not match. Note: Exercise extreme caution when dropping a user property. This action cannot be undone. This action has an impact on your schema because it purges all data for the discarded user property. It also drops any future incoming user property with the same name. Allow property: This allows the property even if the data type does not match. An error is reported for all actions. A drop will have a higher severity and allow will have a lower severity. For more information, refer to Error Stream. |
Created on | The date when the user property was created. |
Add User Property
To add a user property from this page:
- Click the +Property button.
- Enter a property name and choose a data type.
- Click the checkmark.
Edit User Property
You can edit any column; however, you can only edit names for unpublished user properties. To edit a property, click the edit icon on the property row.
- Click the edit icon on the property row.
- Edit the property name and the data type.
- Click the checkmark.
Remove User Property
You can remove an unpublished property.
- Click the ellipsis icon on the property row.
- Click Remove.
After a user property is removed:
- The entire user property row is removed from the schema.
- If a user property comes in with the same name, it is considered as an undefined user property.
Discard User Property
You can discard a published user property from the schema. You can still see the property row in the schema; however, it will be marked as discarded.
- Click the ellipsis icon on the property row.
- Click Discard, and a new window displays.
- Click Discard again.
Caution When Discarding a User Property
Exercise extreme caution when discarding a user property. This action cannot be undone. This action has an impact on your schema because it purges data for the discarded user property. It also drops any future incoming user property with the same name.
System Events
System events are tracked automatically. You can only change the DRP for these events and can choose to allow CleverTap to record the push impression event.
Conversion Event
The conversion event helps track conversion.
To set a conversion event:
- Navigate to Settings > Schema > Events.
- Click the Conversion event tab.
To track revenue, set the user conversion event and revenue property. This property must be a numeric value.
Qualifying Event
To set a qualifying event:
- Navigate to Settings > Schema > Events.
- Click the Qualifying event tab.
This event qualifies users as active if they have performed the event at least once in the defined time.
The qualifying event is currently used in the active % tab on the Trends page.
Download Schema Data from Dashboard
You can download the data for all events and user profiles from the CleverTap dashboard or via an API.
Event Data
To download event data from the CleverTap dashboard in CSV format:
- Navigate to Settings > Schema > Events. You can download event data from the System events tab or the Custom event tab.
- Click the Download as CSV button, then the Download CSV file window displays.
- Select to download Events or Events with properties.
- Click Download.
User Profile data
To download all event data from the CleverTap dashboard in CSV format:
- Navigate to Settings > Schema > User Properties.
- Click the Download as CSV button.
Download with API
To download event data or user profile data with API, refer to the following:
- Use the Events Schema API to download event data.
- Use the User Properties Schema API to download user profile data.
Considerations
There are some specific validations when creating events and properties. For more information, refer to Platform Considerations.
Updated almost 2 years ago