Semantic Objects

Introduction

Semantic Objects (allong with their Attribute) allow you to track data that can add extra functionality to Fanplayr 360. For example you may track an event for product views with the Attribute Key $product which may then be shown in the list of Top 10 Products by View in Insights / Products.

Semantic Attributes can be used with any tracking call. Semantic Events may support specific Semantic Attributes, for example when using $order with the Order Completed event, Fanplayr 360 will use the details to display total Revenue in Insights.

These attributes will be pre-populated in the Data Dictionary.

Following is a list that defines the structure for these Semantic Objects, along with the attribute key and any related Semantic Attributes.

Product

Represents a product in an e-commerce store.

interface Product {
  id?: string
  sku?: string
  name?: string
  categories?: string[]
  price?: number
  quantity?: number
  url?: string
  imageUrl?: string
  currency?: string
  variant?: string
  color?: string
  size?: string
  brand?: string
}

Products

Represents a group of Products.

  • Attribute Key - $products

  • products - Product

type Products = Array<Product>

Cart

Represents a shopping cart in a store.

interface Cart {
  id?: string
  revenue?: number
  revenueAccountCurrency?: number
  currency?: string
  discount?: number
  discountAccountCurrency?: number
  discountCode?: string
  tax?: number
  taxAccountCurrency?: number
  shipping?: number
  shippingAccountCurrency?: number
  products?: Product[]
  location?: Location
}

Order

Represents a transaction in a store, such as a completed or returned order.

interface Order {
  orderNumber?: string
  revenue?: number
  revenueAccountCurrency?: number
  cartId?: string
  discount?: number
  discountAccountCurrency?: number
  discountCode?: string
  tax?: number
  taxAccountCurrency?: number
  shipping?: number
  shippingAccountCurrency?: number
  products?: Product[]
  location?: Location
  billingLocation?: Location
  shippingLocation?: Location
  returnReference?: string
  returnReason?: string
  cashier?: string
  salesperson?: string
}

Message

Represents a message that has been sent to a user through a medium such as postal mail, email, SMS, web push notification etc.

  • Attribute Key - $message

interface Message {
  type?: string
  recipient?: string
  id?: string
  subject?: string
  campaign?: string
  browser?: string
  os?: string
  device?: string
}
  • id - a unique identifier for this message that remains the same between message events such as Message Sent or Message Delivered.

  • type - the type of message such as "email", "sms", "notification", "line" or "whatsapp".

  • recipient - the email address, phone number, or other identifier that is used to send the message.

  • subject - used for the subject of an email or similar.

  • campaign - the name of the campaign used to send the message. Examples may be "Abandoned Cart" and "Summer 2022 Sale".

Location

Represents a physical location tied to an event.

  • Attribute Key - $location or $billingLocation or $shippingLocation

Different attribute keys let Fanplayr 360 know a location is used for different purposes.

interface Location {
  id?: string
  name?: string
  country?: string
  countryCode?: string
  region?: string
  city?: string
  postalCode?: string
  street?: string
  text?: string
  latitude?: number
  longitude?: number
}

Represents a search performed on an e-commerce website.

  • Attribute Key - $search

interface Search {
  query?: string
}

Recommendation

Represents a recommendation made in an e-commerce store or application.

  • Attribute Key - $recommendation

  • products - Product

interface Recommendation {
  id?: string
  products?: Product[]
  model?: string
  productDisplayId?: string
  widgetId?: string
}
  • id - Represents the unique identifier for the recommendation result. The same identifier should be used for recommendation events that relate to the same result. E.g. "Recommendation Viewed", "Recommendation Clicked", "Recommendation Purchased" etc.

  • products - All the products that we viewed/clicked/purchased in the recommendation.

  • model - The name or type of the recommendation model used.

Targeting

An object representing details related to Fanplayr Targeting.

  • Attribute Key - $targeting

interface Targeting {
  offerId?: string
  experimentId?: string
  actionId?: string
}

Widget

An object representing an individual widget.

  • Attribute Key - $widget

interface Widget {
  id?: string
  name?: string
  variant?: string
  breakpoint?: string
  action?: string
  revisionId?: string
  language?: string
}

UTM

An object representing details related to UTM parameters.

  • Attribute Key - $utm

interface UTM {
  id?: string
  medium?: string
  source?: string
  term?: string
  campaign?: string
  content?: string
}

Page

Details related to the page view associated with the event.

  • Attribute Key - $page

interface Page {
  name?: string
  path?: string
  referrer?: string
  title?: string
  type?: string
  url?: string
}

Device

Details related to the device that generated the event.

  • Attribute Key - $device

interface Device {
  browser?: string
  browserMajorVersion?: number
  browserMinorVersion?: number
  city?: string
  continent?: string
  country?: string
  countryCode?: string
  family?: string
  ipAddress?: string
  latitude?: number
  longitude?: number
  os?: string
  osMajorVersion?: number
  osMinorVersion?: number
  postalCode?: string
  region?: string
  regionCode?: string
  timezone?: string
  type?: string
  userAgent?: string
}

Session

An object representing a browsing session.

  • Attribute Key - $session

interface Session {
  domain?: string
  durationSecs?: number
  endTime?: string
  id?: string
  orderCount?: number
  pageCount?: number
  startTime?: string
}

Last updated