Skip to content

Instantly share code, notes, and snippets.

@mems
Last active August 10, 2020 13:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mems/5b0ddd2b0bcccb18ec3308843e6e6f36 to your computer and use it in GitHub Desktop.
Save mems/5b0ddd2b0bcccb18ec3308843e6e6f36 to your computer and use it in GitHub Desktop.
JSON Schema for CEDDL 1.0

JSON Schema (draft-07) for W3C Customer Experience Digital Data Layer (CEDDL) 1.0

Based on Mikael Kohlmyr's JSON Schema of CEDDL

To test data against the schema:

  1. open JSON Schema Validator - Newtonsoft

Or

  1. open RunKit + npm: ajv
  2. past the following code in the playground textarea
  3. fill it
  4. then "run" (button below the textarea)
  5. see the result
const Ajv = require('ajv');
const ajv = new Ajv({allErrors: true});
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'));

function test(data) {
  const valid = validate(data);
  if (valid){
    console.log('Valid!');
  }
  else{
    console.log('Invalid: ' + ajv.errorsText(validate.errors));
  }
}

const schema ={
  /* the content of CEDDL Schema */
};

const digitalData = {
  /* your digitalData here */
};

const validate = ajv.compile(schema);
test(digitalData);
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://www.w3c.org/json-schema/custexpdata/digital-data/ceddl-1.0",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"required": [
"version"
],
"properties": {
"version": {
"type": "string",
"title": "Version",
"description": "The version number corresponding to the W3C Community Specification for Customer Experience Digital Data followed by the JSO.",
"const": "1.0"
},
"pageInstanceID": {
"type": "string",
"title": "Page Identifier",
"description": "A unique identifier for a page or other piece of content for which data is being collected.\nThis value should distinguish among environments, such as whether this page is in development, staging, or production. (Contrast with digitalData.page.pageID, which may be unique only within a particular environment.)",
"examples": [
"MyHomePage-Production",
"ProductDetailPageNikonCamera-Staging"
]
},
"page": {
"description": "Describes the page",
"$ref": "#/definitions/page"
},
"product": {
"title": "Products",
"description": "List of products.",
"type": "array",
"items": {
"$ref": "#/definitions/product"
}
},
"cart": {
"$ref": "#/definitions/cart"
},
"transaction": {
"$ref": "#/definitions/transaction"
},
"event": {
"title": "Events",
"description": "List of events that were measured.",
"type": "array",
"items": {
"$ref": "#/definitions/event"
}
},
"component": {
"title": "Components",
"description": "List of page components.",
"type": "array",
"items": {
"$ref": "#/definitions/component"
}
},
"user": {
"title": "Users",
"description": "List of user(s) interacting with the page. (Although typically web data has a single user per recorded interaction, this object is an array and can capture multiple users.)",
"type": "array",
"items": {
"$ref": "#/definitions/user"
}
},
"privacy": {
"$ref": "#/definitions/privacy"
}
}
}
],
"definitions": {
"extensible-object": {
"title": "Extensible object",
"$comment": "CEDDL 1.0, 6.13 Extending the Specification",
"description": "When extending the data layer, names should not use JavaScript reserved words, predefined names, or event handlers for the names of objects or properties.",
"type": "object",
"propertyNames": {
"$comment": "CEDDL 1.0, Appendix A Reserved Names and Identifiers\npattern: ^(?!(break|enum|instanceof|super|yield|case|export|interface|switch|catch|extends|let|this|class|finally|new|throw|continue|for|package|try|debugger|function|private|typeof|default|if|protected|var|delete|implements|public|void|do|import|return|while|else|in|static|with|alert|element|Infinity|Object|scroll|all|elements|isFinite|offscreenBuffering|secure|anchor|embed|isNaN|open|select|anchors|embeds|isPrototypeOf|opener|self|area|encodeURI|java|option|setInterval|encodeURIComponent|JavaArray|outerHeight|setTimeout|assign|escape|JavaClass|outerWidth|status|blur|eval|JavaObject|packages|String|button|event|JavaPackage|pageXOffset|submit|checkbox|fileUpload|innerHeight|pageYOffset|taint|clearInterval|focus|innerWidth|parent|text|clearTimeout|form|layer|parseFloat|textarea|clientInformation|forms|layers|parseInt|top|close|frame|length|password|toString|closed|frames|link|pkcs11|undefined|confirm|frameRate|location|plugin|unescape|constructor|function|Math|prompt|untaint|crypto|getClass|mimeTypes|propertyIsEnum|valueOf|Date|hasOwnProperty|name|prototype|window|decodeURI|hidden|NaN|radio|decodeURIComponent|history|navigate|reset|defaultStatus|image|navigator|screenX|document|images|Number|screenY|onbeforeunload|oncontextmenu|onkeydown|onmousedown|onmouseup|onblur|ondragdrop|onkeypress|onmousemove|onreset|ondragdrop|onerror|onkeyup|onmouseout|onsubmit|onclick|onfocus|onload|onmouseover|onunload)$).*$"
}
},
"data-object": {
"title": "Data object",
"description": "This object contains data with access control for privacy",
"allOf": [
{
"$ref": "#/definitions/extensible-object"
},
{
"type": "object",
"title": "Security Object",
"description": "Used to enforce data access control",
"$comment": "CEDDL 1.0, 6.11 Security Object",
"properties": {
"security": {
"$ref": "#/definitions/security"
}
}
}
]
},
"attributes": {
"title": "Attributes",
"description": "This object provides extensibility to the parent object.",
"$ref": "#/definitions/data-object"
},
"security": {
"title": "Security",
"description": "The Security object is an optional sub-object of each object in the JSO, which can be used to enforce data access control over that object. If a Security object is defined for an object, the value should be a comma-separated list of categories defined as categoryName in the Privacy object. If a Security object is not defined for an object, no data access controls will be enforced.\nThe Default category is required for security enforcement. The Default category has access to all children of the digitalData element and does not need to be explicitly listed in Security objects.",
"anyOf": [
{
"allOf": [
{
"$ref": "#/definitions/extensible-object"
},
{
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/privacy-category-name"
}
},
{
"$ref": "#/definitions/privacy-category-name"
}
]
}
}
]
},
{
"$ref": "#/definitions/privacy-category-name"
},
{
"type": "null"
}
]
},
"page": {
"title": "Page",
"description": "Describes a page",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"pageInfo": {
"title": "Page Info",
"description": "Describes details about the page.\nIt's recommended for fields containing date to use ISO 8601 format.\nIt's recommended for fields containing language or locale to use ISO 3166 and 639.",
"$ref": "#/definitions/page-info"
},
"category": {
"$ref": "#/definitions/category"
},
"attributes": {
"$ref": "#/definitions/attributes"
}
}
}
],
"examples": [
{
"pageInfo": {
"sysEnv": "EC2AMAZ-DPNS3JK"
},
"category": {
"primaryCategory": "FAQ Pages",
"subCategory1": "ProductInfo",
"$comment": "page type: home, product listing, search result, information, blog post, faq, etc.",
"pageType": "FAQ"
},
"attributes": {
"environment": "production",
"referringSearchEngine": "duckduckgo"
}
},
{
"pageInfo": {
"pageName": "New hair treatment method"
},
"category": {
"primaryCategory": "studies",
"pageType": "post"
},
"attributes": {
"$comment": "For a blog post page with comments and word count",
"comments": 10,
"wordCount": 3194,
"keywords": [
"treatment",
"hair",
"hair loss"
]
}
},
{
"pageInfo": {
"onsiteSearchTerm": "hair treatment",
"onsiteSearchResults": 10
},
"category": {
"primaryCategory": "Treatments",
"pageType": "SearchResult"
},
"attributes": {
"currentPage": 10,
"totalPages": 200,
"$comment": "Sorting: relevance, newest, oldest, price desc, etc.",
"refinement": "shampoo",
"sorting": "relevance"
}
},
{
"pageInfo": {
"pageID": "page-404-f23w1isz",
"pageName": "Page not found"
},
"attributes": {
"statusCode": 404,
"statusText": "Not Found"
}
}
]
},
"page-info": {
"title": "Page info",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"pageID": {
"type": "string"
},
"pageName": {
"type": "string"
},
"destinationURL": {
"title": "Page URL",
"description": "Equivalent of JavaScript document.location",
"type": "string",
"format": "uri"
},
"referringURL": {
"title": "Page Referrer",
"description": "Equivalent of JavaScript document.referrer",
"type": "string",
"format": "uri"
},
"sysEnv": {
"type": "string"
},
"variant": {
"type": "string"
},
"version": {
"type": "string",
"description": "Semver format is recommended."
},
"breadcrumbs": {
"type": "array",
"items": {
"type": "string"
}
},
"author": {
"type": "string"
},
"issueDate": {
"$ref": "#/definitions/date"
},
"effectiveDate": {
"$ref": "#/definitions/date"
},
"expiryDate": {
"$ref": "#/definitions/date"
},
"language": {
"$ref": "#/definitions/language"
},
"industryCodes": {
"type": "string",
"description": "SIC codes. https://en.wikipedia.org/wiki/Standard_Industrial_Classification",
"examples": [
"3990"
]
},
"publisher": {
"type": "string"
},
"onsiteSearchTerm": {
"description": "Onsite search query term",
"type": "string"
},
"onsiteSearchResults": {
"description": "Onsite search number of results",
"type": "number"
}
}
}
],
"examples": [
{
"pageID": "316",
"pageName": "Rogaine Hair Regrowth Treatment",
"destinationURL": "https://site.com/r.html",
"referringURL": "https://www.google.com/url?&q=&esrc=s",
"sysEnv": "mobile",
"variant": "test1=original; test2=version-1; test3=version-2",
"version": "1.14",
"breadCrumbs": [
"home",
"products",
"haircare"
],
"author": "J Smith",
"issueDate": "2013-09-01",
"effectiveDate": "2013-09-20",
"expiryDate": "2014-09-20",
"language": "en-US",
"geoRegion": "US",
"industryCodes": "3990",
"publisher": "BusDev"
}
]
},
"category": {
"title": "Category",
"description": "Because of the wide range of methods for categorization, an object literal is provided for the parent object categories.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"primaryCategory": {
"type": "string"
}
}
}
]
},
"product-info": {
"title": "Product Info",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"productID": {
"type": "string"
},
"productName": {
"type": "string"
},
"description": {
"type": "string"
},
"productURL": {
"type": "string",
"format": "uri"
},
"productImage": {
"type": "string",
"format": "uri"
},
"productThumbnail": {
"type": "string",
"format": "uri"
},
"manufacturer": {
"type": "string"
},
"sku": {
"type": "string"
},
"color": {
"type": "string"
},
"size": {
"type": "string"
}
}
}
],
"examples": [
{
"productID": "rog3000",
"productName": "Rogaine",
"description": "Hair Regrowth",
"productURL": "https://site.com/r.html",
"productImage": "https://site.com/rog300_large.png",
"productThumbnail": "https://site.com/rog300_thumb.png",
"manufacturer": "Pharmecutical Company",
"size": "300ml"
}
]
},
"product": {
"title": "Product",
"description": "The Product object carries details about a particular product with frequently used properties listed below. This is intended for data about products displayed on pages or other content. For products added to a shopping cart or ordered in a transaction, see the Cart and Transaction objects.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"productInfo": {
"title": "Product Info",
"description": "This object describes the product.",
"$ref": "#/definitions/product-info"
},
"category": {
"title": "Product categories",
"description": "Because of the wide range of methods for categorization, an object literal is provided for product categories.\nThe name primaryCategory is recommended if you included only one set of categories for products, or for your primary set of categories.",
"$ref": "#/definitions/category",
"examples": [
{
"primaryCategory": "Haircare",
"subCategory1": "Men's",
"productType": "Thining Hair Treatments"
}
]
},
"linkedProduct": {
"title": "Product linked products",
"description": "List of products linked to this product.",
"type": "array",
"items": {
"$ref": "#/definitions/product"
}
},
"price": {
"title": "Product price",
"$ref": "#/definitions/price"
},
"attributes": {
"title": "Product attributes",
"description": "This object provides extensibility to the Product object. Any additional dimensions related to the product can be provided.",
"$ref": "#/definitions/attributes",
"examples": [
{
"offer": [
{
"seller": "Marketplace seller 1",
"$comment": "availability: in stock, in store only, online only, out of stock, sold out, preorder, presale, discontinued, etc.",
"availability": "preorder",
"availabilityDate": "2019-03-16"
}
]
}
]
}
}
}
]
},
"price": {
"title": "Price",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"basePrice": {
"description": "Should be the price before applicable discounts, shipping charges, and tax.",
"type": "number"
},
"currency": {
"description": "It's recommended to use ISO 4217 format.",
"type": "string",
"examples": [
"EUR",
"USD"
]
},
"taxRate": {
"type": "number"
},
"shipping": {
"type": "number"
},
"shippingMethod": {
"type": "string",
"examples": [
"UPS"
]
},
"priceWithTax": {
"type": "number"
},
"voucherCode": {
"type": "string",
"examples": [
"Alpha"
]
},
"voucherDiscount": {
"type": "number"
}
}
}
]
},
"address": {
"title": "Address",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"line1": {
"type": "string"
},
"line2": {
"type": "string"
},
"city": {
"type": "string"
},
"stateProvince": {
"type": "string"
},
"postalCode": {
"type": "string"
},
"country": {
"type": "string"
}
}
}
],
"examples": [
{
"line1": "673 My Street",
"line2": "Apt 1",
"city": "Austin",
"stateProvince": "TX",
"postalCode": "78610",
"country": "USA",
"specialInstruction": "Beware of Dog"
}
]
},
"language": {
"title": "Language",
"description": "It's recommended to use ISO 3166 and 639 formats.",
"type": "string",
"examples": [
"en-US",
"en-GB",
"fr-FR",
"fr-CA",
"fr-BE"
]
},
"date": {
"title": "Date",
"description": "It's recommended to use ISO 8601 format (or RFC 3339 date-time).",
"anyOf": [
{
"type": "string",
"format": "date-time",
"examples": [
"2014-09-20T00:00:00.000Z"
]
},
{
"type": "string",
"format": "date",
"examples": [
"2014-09-20"
]
},
{
"type": "string"
}
]
},
"cart": {
"title": "Cart",
"description": "The Cart object carries details about a shopping cart or basket and the products that have been added to it. The Cart object is intended for a purchase that has not yet been completed. See the Transaction object for completed orders.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"cartID": {
"title": "Cart ID",
"description": "An identifier for a particular shopping cart.",
"type": "string"
},
"price": {
"title": "Cart price",
"description": "This object provides details of the cart price.",
"allOf": [
{
"$ref": "#/definitions/price"
},
{
"type": "object",
"properties": {
"cartTotal": {
"title": "Cart total",
"description": "The total price inclusive of all discounts, charges, and tax",
"type": "number",
"examples": [
125
]
}
}
}
],
"examples": [
{
"basePrice": 200.0,
"voucherCode": "Alpha",
"voucherDiscount": 0.5,
"currency": "EUR",
"taxRate": 0.2,
"shipping": 5.0,
"shippingMethod": "UPS",
"priceWithTax": 120,
"cartTotal": 125
},
{
"basePrice": 1000.0,
"currency": "USD",
"fees": 200,
"taxRate": 0.08,
"cartTotal": 1296.0
}
]
},
"attributes": {
"title": "Cart attributes",
"description": "This object provides extensibility to the cart as a whole. Any additional dimensions related to the cart can be provided.",
"$ref": "#/definitions/attributes"
},
"item": {
"title": "Cart items",
"description": "List of items in the cart.",
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/definitions/product"
},
{
"type": "object",
"properties": {
"quantity": {
"title": "Cart item quantity",
"description": "Quantity of this particular item in the cart.",
"type": "number"
}
}
}
]
}
}
}
}
],
"examples": [
{
"cartID": "BASKET2203",
"price": {
"basePrice": 380.0,
"voucherCode": "MYVOUCHER1",
"voucherDiscount": 38.4,
"currency": "GBP",
"taxRate": 0.2,
"shipping": 4,
"shippingMethod": "1st Class Royal Mail",
"priceWithTax": 380,
"cartTotal": 414.72
},
"item": [
{
"productInfo": {
"productID": "1234567890",
"productName": "Sparkly Shoes",
"description": "Description about this product",
"productURL": "https://example.com/product.html",
"manufacturer": "The Shoe Co",
"sku": "0987654321",
"color": "n/a",
"size": "6"
},
"price": {
"basePrice": 380.0,
"voucherCode": "MYVOUCHER1",
"voucherDiscount": 38.4,
"currency": "GBP",
"taxRate": 0.2,
"priceWithTax": 380
},
"category": {
"primaryCategory": "Shoe",
"subcategory1": "Heels"
}
}
]
}
]
},
"event": {
"title": "Event",
"description": "The Event object collects information about an interaction event by the user. An event might be a button click, the addition of a portal widget, playing a video, adding a product to the shopping cart, etc. Any action on the page could be captured by an Event object.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"eventInfo": {
"title": "Event info",
"description": "This object describes the event.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"required": [
"eventName"
],
"properties": {
"eventName": {
"type": "string"
},
"eventAction": {
"type": "string"
},
"eventPoints": {
"type": "number"
},
"type": {
"type": "string"
},
"timeStamp": {
"$ref": "#/definitions/date"
},
"cause": {
"type": "string"
},
"effect": {
"type": "string"
}
}
}
]
},
"category": {
"description": "Because of the wide range of methods for categorization, an object literal is provided for page categories.",
"$ref": "#/definitions/category"
},
"attributes": {
"description": "This object provides extensibility to each event. Any additional dimensions related to the event can be provided.",
"$ref": "#/definitions/attributes"
}
}
}
],
"examples": [
{
"eventInfo": {
"eventName": "Add News Portal",
"eventAction": "addportal",
"eventPoints": 200,
"type": "contentModifier",
"timeStamp": "2014-09-20T00:00:00.000Z",
"effect": "include portal 1234",
"eventID": "123456"
},
"category": {
"primaryCategory": "Portal",
"subCategory1": "dashboard"
},
"attributes": {
"cause": "Portal Selection From Dropdown",
"effect": "Add News Portal",
"$comment": "When an event is generated by a user action, it's trusted. See https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted",
"isTrusted": true
}
},
{
"eventInfo": {
"eventName": "submitted example form",
"type": "form"
},
"attributes": {
"myprop": "myvalue"
}
}
]
},
"transaction": {
"title": "Transaction",
"description": "The Transaction object is similar to the Cart object, but represents a just completed order (if this is the first page view served to the user since they completed the transaction). The Transaction object contains analogous sub-objects to the Cart object as well as additional sub-objects specific to completed orders.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"transactionID": {
"title": "Transaction ID",
"description": "A unique identifier for a particular transaction; usually an existing order identifier",
"type": "string"
},
"profile": {
"title": "Purchaser profile",
"description": "A profile for information about the purchaser, typically associated with a registered user.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"profileInfo": {
"title": "Purchaser informations",
"description": "An extensible object for providing information about the purchaser.",
"$ref": "#/definitions/profile-info"
},
"address": {
"title": "Billing address",
"description": "An extensible object for providing (billing) address information for the purchaser.",
"$ref": "#/definitions/address"
},
"shippingAddress": {
"title": "Shipping address",
"description": "As for address, but for the shipping address",
"$ref": "#/definitions/address"
}
}
}
]
},
"total": {
"allOf": [
{
"$ref": "#/definitions/price"
},
{
"type": "object",
"properties": {
"transactionTotal": {
"title": "Transaction total",
"description": "The transactionTotal should be the total price inclusive of all discounts, charges, and tax.",
"type": "number",
"examples": [
125
]
}
}
}
]
},
"attributes": {
"description": "This object provides extensibility to the transaction as a whole. Any additional dimensions related to the cart can be provided.",
"$ref": "#/definitions/attributes",
"examples": [
{
"paymentMethod": "credit card",
"affiliation": "Some affiliate"
}
]
},
"item": {
"description": "List of items in the transaction.",
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/definitions/product"
},
{
"type": "object",
"properties": {
"quantity": {
"description": "Quantity of this particular item ordered.",
"type": "number"
}
}
}
]
}
}
}
}
]
},
"component": {
"title": "Component",
"description": "The Component object is intended to capture information about a content component included as part of a page, such as a video. Interactions with the component — such as playing the video — would be an Event, captured by the Event object above.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"componentInfo": {
"title": "Component info",
"description": "This object describes the component.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"componentID": {
"type": "string"
}
}
}
]
},
"category": {
"description": "Because of the wide range of methods for categorization, an object literal is provided for page categories.",
"$ref": "#/definitions/category"
},
"attributes": {
"description": "This object provides extensibility to each component. Any additional dimensions related to the component can be provided.",
"$ref": "#/definitions/attributes"
}
}
}
],
"examples": [
{
"componentInfo": {
"componentID": "rog300v",
"componentName": "How to Use Rogaine",
"description": "Hair Treatment Video"
},
"category": {
"primaryCategory": "Haircare",
"subCategory1": "Videos",
"componentType": "Flash Movie"
},
"attributes": {
"socialWidgetName": "some video widget"
}
}
]
},
"profile-info": {
"title": "Profile Info",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"profileID": {
"type": "string"
},
"userName": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
}
}
}
],
"examples": [
{
"profileID": "humanbeing12345",
"userName": "me"
}
]
},
"profile": {
"title": "User profile",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"profileInfo": {
"title": "User profile infos",
"description": "An extensible object for providing information about the user.",
"allOf": [
{
"$ref": "#/definitions/profile-info"
},
{
"type": "object",
"properties": {
"language": {
"$ref": "#/definitions/language"
},
"returningStatus": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
],
"examples": [
{
"profileID": "jdoe",
"userName": "John Doe",
"email": "jdoe@example.com",
"returningStatus": "new",
"language": "en-gb"
},
{
"profileID": "yq32659",
"userName": "Yiwen Qin",
"returningStatus": "returning",
"language": "zh-Hans"
}
]
},
"address": {
"description": "An extensible object for providing address information for the user",
"$ref": "#/definitions/address"
},
"social": {
"description": "An extensible object for providing social information for the user profile.",
"$ref": "#/definitions/data-object",
"examples": [
{
"twitter": "somebody",
"twitterInfo": "stuff",
"facebook": "somebody1234",
"facebookInfo": "morestuff"
},
{
"facebook": {
"id": "12345678901232345",
"userName": "John Doe",
"age_range": [
21,
null
]
},
"twitter": {
"id": "12345",
"screenName": "johnthedoe"
}
}
]
},
"attributes": {
"description": "This object provides extensibility to the profile.",
"$ref": "#/definitions/attributes",
"examples": [
{
"$comment": "authState provide the information of user authentication.",
"authState": "logged in"
}
]
}
}
}
]
},
"user": {
"title": "User",
"description": "The User object captures the profile of a user who is interacting with the website.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"profile": {
"description": "A profile for information about the user, typically associated with a registered user. (Although typically a user might have only a single profile, this object is an array and can capture multiple profiles per user.)",
"type": "array",
"items": {
"$ref": "#/definitions/profile"
}
},
"segment": {
"description": "This object provides population segmentation information for the user, such as premium versus basic membership, or any other forms of segmentation that are desirable. Any additional dimensions related to the user can be provided.",
"$ref": "#/definitions/data-object",
"examples": [
{
"$comment": "membershipType provide information of user membership type (non member, basic, premium).\nmembershipStatus provide information of user membeship reason (active, no renewed, revoked, trial end, etc.).\nsubscriptionOffer provide the information of user subscription offer (free trial, paid).\nsubscriptionRenewal is the recurring payment of membership fee (monthly, yearly, three-yearly, thrice-yearly)",
"membershipType": "premium",
"membershipDate": "2018-05-22",
"subscriptionRenewal": "monthly"
},
{
"$comment": "subscriptionStatus provide information of user subscription reason (active, expired, no renewed, revoked, trial end, etc.).\nsubscriptionOffer provide the information of user subscription offer (free trial, paid).\nsubscriptionRenewal is the recurring payment of subscription fee (monthly, yearly, three-yearly, thrice-yearly)",
"subscriptionType": "all-products",
"subscriptionOffer": "paid",
"subscriptionStatus": "active",
"subscriptionRenewal": "yearly"
}
]
}
}
}
]
},
"privacy-category": {
"title": "Privacy category",
"description": "Common categories include Default (same as first party for privacy purposes), Analytics, Recommendations, and Personalization.",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"required": [
"categoryName"
],
"properties": {
"categoryName": {
"description": "Definition of category names to be associated with security objects with the matching name",
"$ref": "#/definitions/privacy-category-name"
},
"domains": {
"description": "Particular vendors associated with the particular category. This SHOULD be an array listing domains for vendors associated with the category.",
"type": "array",
"items": {
"type": "string",
"format": "hostname",
"examples": [
"nonexistent-store.com",
"audit.com",
"calc.com",
"adsRus.com"
]
}
}
}
}
]
},
"privacy": {
"title": "Privacy",
"description": "The Privacy object holds the privacy policy settings that could be used to:\n1. Capture and enforce site visitor consent to use tracking technologies on the site.\n2. Together with Security objects described below, secure access to individual objects within the JSO by categories of tracking technologies.\nThe Default category SHOULD contain all technologies which must be treated the same as first party for privacy purposes (e.g., a tag management technology).",
"allOf": [
{
"$ref": "#/definitions/data-object"
},
{
"type": "object",
"properties": {
"accessCategories": {
"title": "Privacy categories",
"description": "A list of privacy categories.",
"type": "array",
"items": {
"$ref": "#/definitions/privacy-category"
}
}
}
}
]
},
"privacy-category-name": {
"title": "Privacy category name",
"type": "string",
"default": "Default",
"examples": [
"Analytics",
"Recommendations",
"Personalization"
]
}
},
"examples": [
{
"version": "1.0",
"pageInstanceID": "ProductDetailPageNikonCamera-Staging",
"page": {
"pageInfo": {
"pageID": "Nikon Camera",
"destinationURL": "https://mysite.com/products/NikonCamera.html"
},
"category": {
"primaryCategory": "Cameras",
"subCategory1": "Nikon",
"pageType": "ProductDetail"
},
"attributes": {
"seasonal": "Christmas",
"$comment": "Environements: dev, staging, live, etc.",
"environment": "staging",
"market": "EU",
"affiliation": "Some affiliate"
}
},
"product": [
{
"productInfo": {
"productName": "Nikon SLR Camera",
"sku": "sku12345",
"manufacturer": "Nikon"
},
"category": {
"primaryCategory": "Cameras"
},
"attributes": {
"productType": "Special Offer",
"comments": 10
}
}
]
},
{
"$comment": "Healthcare Insurance Industry example, with additional member object used to capture a member's account details with the institution",
"version": "1.0",
"member": [
{
"memberID": "2723 49202388 01",
"age": 41,
"groupRelationship": "436378",
"groupName": "Employer, Inc.",
"relation": "Spouse",
"gender": "M",
"originalJoinDate": "2011-01-21",
"postalCode": "15214"
}
]
},
{
"$comment": "Healthcare Insurance Industry example, with additional application object",
"version": "1.0",
"application": {
"appID": "7565-2373-0086-8937",
"source": "Telephone",
"status": "Pending",
"creationDate": "2013-12-15T13:20:02.000Z",
"completionDate": "2013-12-15T15:05:16.000Z"
}
},
{
"$comment": "Healthcare Insurance Industry example, with additional plan object",
"version": "1.0",
"plan": {
"planName": "Family Advantage 250",
"planType": "EPO",
"policyStatus": "Current",
"premium": 454.25,
"effectiveDate": "2013-12-15T15:05:16.000Z"
}
},
{
"$comment": "Airline flight industry example",
"version": "1.0",
"product": [
{
"productInfo": {
"productID": "734565538989889110",
"description": "Business Class One-Way Ticket"
},
"attributes": {
"originAirportCode": "RDU",
"originCity": "Raleigh",
"originState": "North Carolina",
"originCounty": "USA",
"destinationAirportCode": "BOM",
"destinationState": "Maharashtra",
"destinationCountry": "India",
"departureDate": "2013-12-15T13:20:00.000Z",
"arrivalDate": "2013-12-16T20:40:00.000Z",
"travellers": 1
}
}
],
"cart": {
"price": {
"basePrice": 1000.0,
"currency": "USD",
"fees": 200,
"taxRate": 0.08,
"cartTotal": 1296.0
}
},
"user": [
{
"profile": [
{
"profileInfo": {
"profileID": "2723 49202388 01"
},
"attributes": {
"age": "41",
"groupID": "436378",
"groupName": "Employer, Inc.",
"relation": "Spouse",
"gender": "M",
"creationDate": "2011-01-21"
},
"address": {
"postalCode": "15214"
},
"segment": {
"$comment": "Frequent flyer club as Customer’s loyalty level",
"frequentFlyerClub": "Silver Elite"
}
}
]
}
]
},
{
"version": "1.0",
"order": {
"item": [
{
"orderInfo": {
"orderID": "123456",
"$comment": "fulfillment (shipped, pick up in store, backorder, etc.)",
"fulfillmentMethod": "shipped"
},
"total": {
"currency": "EUR",
"shippingMethod": "1st Class Royal Mail",
"orderTotal": 414.72
},
"profile": {
"profileInfo": {},
"shippingAddress": {
"line1": "673 My Street",
"line2": "Apt 1",
"city": "Austin",
"stateProvince": "TX",
"postalCode": "78610",
"country": "USA",
"specialInstruction": "Beware of Dog"
}
},
"issueDate": "2013-12-15T15:05:16.000Z",
"item": [
{
"productInfo": {
"productID": "100087613",
"productName": "Wug bundle"
},
"price": {
"currency": "EUR",
"priceWithTax": 380
},
"attributes": {
"type": "bundle"
}
}
]
}
]
}
},
{
"version": "1.0",
"user": [
{
"profile": [
{
"profileInfo": {
"profileID": "user123456",
"userName": "John Doe",
"email": "jdoe@example.com",
"language": "en-gb",
"security": {
"userName": "Personalization",
"email": "Personalization",
"language": [
"Analytics",
"Personalization"
]
}
},
"attributes": {
"marketingChannelConsent": {
"newsletter": true,
"directMailing": true,
"telemarketing": true,
"sms": true
}
},
"address": {
"line1": "673 Mystreet",
"line2": "Apt 1",
"city": "Austin",
"stateProvince": "TX",
"postalCode": "78610",
"country": "USA",
"shippingMethod": "UPS",
"specialInstruction": "Beware of Dog",
"security": {
"line1": "Personalization",
"line2": "Personalization",
"city": [
"Analytics",
"Personalization"
],
"stateProvince": "Analytics",
"postalCode": "Analytics"
}
}
}
]
}
],
"privacy": {
"accessCategories": [
{
"categoryID": "C0001",
"categoryName": "Default"
},
{
"categoryID": "C0002",
"categoryName": "Analytics"
},
{
"categoryID": "C0003",
"categoryName": "Personalization"
}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment