Standard Schema Data Management
The following document outlines the required formatting for all supported event types as well as reserved
identifiers. Should you need to deviate from this collection schema please consult your implementation team before implementation.
Table of Contents
What is an event?
Events represent all inbound data collected from any of the supported methods such as direct to API, via the Lytics JavaScript tag or from a supported integration. Each event sent must include the following:
- Identifier
At minimum one identifier must be included with each event in order to associate the fragment of data with a profile. In the case of the Lytics JavaScript tag, an anonymous identifer called_uid
will be sent with every event. - Event Type
In order to determine how the event should be processed an event type must be included. Only event types from the definitions below can be included. Should you require a custom event type consult with your implementation team to determine options and if it is in scope for the project. - Attributes
Though attributes are not technically required they are what will contain the contextual data required to get the most out of Lytics. Any combination of the defined attributes can be included with each event.
{
"event": "identify",
"email": "[email protected]",
"channel": "web",
"profile": {
"firstName": "Mok",
"lastName": "Wahlboog",
"title": "celebrity"
},
"campaign": {
"name": "who-you-is-campaign"
}
}
Event Types
A single event type should be included in all inbound events to Lytics when using the standard schema. These events dictate the rules around how an event is processed and are extremely important to ensure profiles are accurately generated.
Identifiers | Common | Profile | Site | Item | Campaign | Cart | Subscription | Transaction | |
---|---|---|---|---|---|---|---|---|---|
identification | |||||||||
identify | x | x | x | x | x | ||||
general | |||||||||
click | x | x | x | x | |||||
view | x | x | x | x | |||||
email | |||||||||
open | x | x | x | x | |||||
bounce | x | x | x | ||||||
blocked | x | x | x | ||||||
sent | x | x | x | ||||||
delivered | x | x | x | ||||||
commerce | |||||||||
cart-add | x | x | x | x | x | x | |||
cart-remove | x | x | x | x | x | x | |||
checkout | x | x | x | x | x | x | |||
purchase | x | x | x | x | x | x | |||
refund | x | x | x | x | x | x | |||
b2b/saas | |||||||||
register | x | x | x | x | x | x | |||
login | x | x | x | x | x | x | |||
logout | x | x | x | x | x | x | |||
account-create | x | x | x | x | x | x | |||
account-delet | x | x | x | x | x | x | |||
trial-start | x | x | x | x | x | x | |||
trial-end | x | x | x | x | x | x | |||
custom | x | x | x | x | x | x | x | x | x |
Identifiers
Identifiers represent unique, identifiable value for a user. By default, the Lytics JavaScript tag will append an anonymous _uid
to all collection events but additional identifiers as defined below can and should be leveraged to improve identity resolution.
Key | Description |
---|---|
_uid | Lytics managed id most commonly set based on anonymous cookie |
userId | customer managed unique identifier for entity |
username | unique user name for entity |
email address of entity | |
emailHash | secure hash of email address for entity |
customId | optional custom id placeholder number 1 |
customId2 | optional custom id placeholder number 2 |
customId3 | optional custom id placeholder number 3 |
Attributes
Attributes represent a standard set of meta data associated with an event. For instance, when an event is sent from the web it should include the relevant site
attribute data in order to facilitate the best behavioral understanding. The standard schema supports attributes for a variety of common collection events ranging from ecommerce to generic activity.
Common
Common attributes are optional key/value pairs that can be included with any standard Lytics event. They generally give more context of source, time, etc.
Key | Description |
---|---|
channel | Name of channel such as email , web , mobile , etc. |
sessionId | Unique identifier for session |
timestamp | Time the event took place, if no value passed will default to current time |
timezone | Timezone that the event originated from |
Profile
A person (alive, dead, undead, or fictional).
Key | Schema.org | Description |
---|---|---|
name | The name of the entity. | |
firstName | The first name of a Person. This can be used along with lastName instead of the name property. | |
lastName | The last name of an Person. This can be used along with firstName instead of the name property. | |
jobTitle | The job title of the person (for example, Financial Manager). | |
phone | N | The phone number. |
cell | N | The cellphone number. |
gender | Gender of the person. While http://schema.org/Male and http://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender. | |
birthDate | Date of birth. | |
url | URL of the entity. | |
image | An image of the entity. | |
created | N | Date entity was created. |
updated | N | Date entity was last updated. |
PostalAddress | https://schema.org/PostalAddress | |
address.streetAddress | The street address. For example, 1600 Amphitheatre Pkwy. | |
address.addressRegion | The region in which the locality is, and which is in the country. For example, California or another appropriate first-level Administrative division | |
address.addressLocality | The locality in which the street address is, and which is in the region. For example, Mountain View. | |
address.postalCode | The postal code. For example, 94043. | |
address.addressCountry | The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code. | |
organization.identifier | N | The Identifier of the company. |
organization.name | N | The name of the company. |
organization.url | N | The url of the company. |
Site
Attributes related to a website or online property.
Key | Schema.org | Description |
---|---|---|
referralDomain | N | domain that referred the user |
language | N | users browser language |
device | N | type of device the user is on (mobile, desktop, etc.) |
url | N | url where the event originated |
tagVersion | N | version of tag that emitted the event |
Item
Any offered product or service. For example: a pair of shoes; a concert ticket; the rental of a car; a haircut; or an episode of a TV show streamed online.
Key | Schema.org | Description |
---|---|---|
itemId | The item identifier, such as ISBN. For example: meta itemprop="productID" content="isbn:123-456-789". | |
sku | The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers. | |
name | The name of the item. | |
category | A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy. | |
url | URL of the item. | |
image | An image of the item. | |
value | N | Value, generally cost, of item. |
purchaseDate | The date the item e.g. vehicle was purchased by the current owner. | |
deliveryDate | N | The date the item e.g. vehicle was delviered to the current owner. |
attr1 | N | Flexible attribute of type string, bool, int or number. |
attr2 | N | Flexible attribute of type string, bool, int or number. |
attr3 | N | Flexible attribute of type string, bool, int or number. |
attr4 | N | Flexible attribute of type string, bool, int or number. |
attr5 | N | Flexible attribute of type string, bool, int or number. |
Campaign
Any marketing initiative to be associated for attribution.
Key | Schema.org | Description |
---|---|---|
campaignId | N | The id of the campaign. |
source | N | The source of the campaign, generally utm_source (google, newsletter). |
medium | N | The medium of the campaign, generally utm_medium (cpc, banner, email). |
name | N | The label of the campaign, generally utm_name (spring_sale). |
listId | N | Id of the list the campaign is associated with. |
segmentId | N | Id of the segment the campaign is associated with. |
templateId | N | Id of the template the campaign is assocaited with. |
Cart
An e-commerce shopping cart. Carts are responsible for holding pending transaction details and are commonly marketed against.
Key | Schema.org | Description |
---|---|---|
cartId | N | The id of the shopping unique shopping cart. |
createdDate | N | Date the shopping cart was first created. |
updatedDate | N | Date the shopping cart was last changed. |
totalValue | N | Total value represented by the shopping cart. |
itemCount | N | Total number of items in the shopping cart. |
returnUrl | N | Return url for accessing the shopping cart again. |
Subscription
A subscription, generally referenced in a transaction, represents an ongoing relationship with a product.
Key | Schema.org | Description |
---|---|---|
subscriptionId | N | The id of the subscription. |
cycle | N | The cycle time for the subscription (day, week, annual). |
startDate | N | The date when the subscription was started or will start. |
endDate | N | The date when the subscription ends or ended. |
totalValue | N | The total value represented by the subscription. |
cycleValue | N | The total value represented by each subscription cycle. |
listId | N | The list id associated with the subscription. |
segmentId | N | The segment id associated with the subscription. |
Transaction
A single transaction such as a purchase or reservation. Each transaction will likely have its own unique invoice or id and contain a subset of products or campaign information.
Key | Schema.org | Description |
---|---|---|
orderId | The identifier property represents any kind of identifier for any kind of Thing, such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. | |
orderDate | Date order was placed. | |
itemCount | N | Number of items purchased |
totalTax | N | Total tax if transaction is purchase |
subTotal | N | Subtotal if transaction is purchase |
total | N | Total value if transaction is purchase |