With collections, you can build customized data schemas to match the incoming event data. It is critical to define accurate schemas for your events - we use the AVRO schema to validate each incoming event. If the schema is not defined (or does not match), the event will not be ingested.
Example of the mapped schema is below. You can read here to learn more about building a tracking plan.
Go to Sources and access the "Collections" tab.
After selecting the tab, you will see the collections created in the source.
Some collections are created automatically when the source is created. The recommend NOT to change any of the collections or their properties that are auto-created as it can break the data flow.
Click the "Add collection" and add a corresponding name.
To edit the collection name, navigate to the three dots icon. From the dropdown, select the "Edit collection name" option to change the name.
To delete a collection click on the three vertical dots icon.
To add a field (property), click the plus icon. From the dropdown, select the "Add field". From the appeared side window, you can:
- Name the field
- Assign object type
- Assign field properties
NOTE: prior to adding a nested field, you need to have a record or array type fields created in the collection
From the record type field under the three dots dropdown, select the "Add field" option. You can add multiple fields under a single record or array property.
Nested fields can be accessed from the record or array properties by clicking the arrow to expand the view.
You can assign a field with one of the following object types:
- boolean - is true or false values
- string - text input
- int - (Integer) for numeric values
- long - holds signed integers ranging in value from -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807 (9.2...E+18)
- float - for numeric values with decimals
- double - for a variable that holds very large (or small) numbers. It can contain up to 15 digits in total, including those before and after the decimal point
- record - a list of multiple varied type properties within an object
- array - a list of multiple same-type properties within an object
To build valid dependencies between the collections, primary and foreign keys must be assigned to the required fields. To add a key, tick the checkbox in the field configuration.
After ticking the required checkboxes, FK (foreign key), key icon (primary key) initials will appear in the field row icon field.
Differences between primary and foreign keys:
- Primary Key – must be assigned to any field that is always unique within a created collection. This is necessary for giving each entry a unique identifier.
- Foreign Key - is a field in a collection that refers to the primary key in another collection. The foreign key links collections and allows to use of related collections in the Event editor.
If you select a foreign key option, you must choose the respective foreign collection and foreign fields that refer to the primary key.
A primary key that shows that the field belongs to a profile collection. It is used to identify profile collections that create or merge user profiles.
Select fields that will be used as account identifiers - these data objects should have information about the user (e.g., age, location, gender and etc.). If selected, these collection fields will be available to be used in the segment editor - to filter users by their attributes.
To identify anonymous cross-channel users, select which collection objects will allow you to identify and merge anonymous users into unified master profiles. To do that, you need to choose a collection field that is a common identifier across different sources. Usually, this field is email, but it can also be a phone, loyalty ID number, etc.
Product identifiers mark which fields are used to describe product-related data, such as price, type of the product, size, etc.
Updated 21 days ago