Fanplayr 360
  • Introduction
  • Data
  • Navigation
  • Tutorials
    • Sync High Value Users to Facebook Custom Audience
  • Features
    • Overview
    • Filters
      • Examples
    • Insights
    • Audiences
      • List
      • Editing
    • Automations
      • List
      • Editing
    • Pipelines
      • List
      • Editing
    • Exports
      • List
      • Editing
    • Profiles
      • Profile
  • 🔗Integrations
    • Sources
      • List
      • Editing
    • Destinations
      • List
      • Editing
    • Catalog
      • Amplitude
      • Attentive
      • AWS S3
      • Cordial
      • Custom Integration
      • Facebook Custom Audience
      • FTP/SFTP - Password Authentication
      • Google Ads
      • JavaScript
      • Mailchimp
      • Mailup
      • Pipedrive
      • Salesforce Commerce Cloud
      • Salesforce Marketing Cloud
      • Send In Blue
      • SFTP - SSH Key Authentication
      • Shopify
      • Slack
      • TikTok
      • Twilio
      • VTEX IO
  • Other
    • Mapping
      • Events
      • Event Attributes
    • Data Dictionary
      • Events
      • Event Attributes
      • User Attributes
    • Data Health
    • Compliance
      • PII
      • Consent
    • Account Settings
      • Personal
      • Preferences
      • Company
      • Users
      • Security
      • Invoices
  • 👩‍💻API Reference
    • API Overview
    • JavaScript API
      • Javascript API Reference
    • Custom API
      • Sessions and Users
      • Tracking Page Views
      • Tracking Events
      • Managing Identity
      • User Profile Data
      • Managing Consent
    • Semantic Data
      • Semantic Events
        • E-Commerce
        • Messaging
        • Other
      • Semantic Objects
      • Semantic User Attributes
      • Fanplayr 360 Generated Attributes
  • PrivacyID
  • Appendix
    • Terminology
Powered by GitBook
On this page
  • Introduction
  • Product
  • Products
  • Cart
  • Order
  • Message
  • Location
  • Search
  • Recommendation
  • Targeting
  • Widget
  • UTM
  • Page
  • Device
  • Session
  1. API Reference
  2. Semantic Data

Semantic Objects

PreviousOtherNextSemantic User Attributes

Last updated 1 year ago

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 / Products.

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

These attributes will be pre-populated in the .

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
}
fp360.track('AN_EVENT', {
  $product: {
    id: "23489023",
    sku: "23489023",
    name: "Red Shoes",
    categories: [
      "Shoes & Accessories > Shoes",
      "Shoes & Accessories > Shoes > Women Shoes"
    ],
    price: 49.95,
    quantity: 1,
    url: "https://example.com/products/23489023",
    imageUrl: "https://example.com/products/23489023.jpg",
    currency: "USD",
    variant: "Striped",
    color: "Red",
    size: "US 8",
    brand: "Nike"
  }
})
{
  ...<EVENT_MESSAGE_PROPERTIES>,
  "event": "AN_EVENT",
  "properties": {
    $product: {
      "id": "23489023",
      "sku": "23489023",
      "name": "Red Shoes",
      "categories": [
        "Shoes & Accessories > Shoes",
        "Shoes & Accessories > Shoes > Women Shoes"
      ],
      "price": 49.95,
      "quantity": 1,
      "url": "https://example.com/products/23489023",
      "imageUrl": "https://example.com/products/23489023.jpg",
      "currency": "USD",
      "variant": "Striped",
      "color": "Red",
      "size": "US 8",
      "brand": "Nike"
    }
  }
}

Products

  • Attribute Key - $products

type Products = Array<Product>
fp360.track('AN_EVENT', {
  $products: [
    {
      id: "23489023",
      sku: "23489023",
      name: "Red Shoes",
      categories: [
        "Shoes & Accessories > Shoes",
        "Shoes & Accessories > Shoes > Women Shoes"
      ],
      price: 49.95,
      quantity: 1,
      url: "https://example.com/products/23489023",
      imageUrl: "https://example.com/products/23489023.jpg",
      currency: "USD",
      variant: "Striped",
      color: "Red",
      size: "US 8",
      brand: "Nike"
    },
    {
      id: "123",
      name: "Another Product"
    }
  ]
})
[
  {
    "id": "23489023",
    "sku": "23489023",
    "name": "Red Shoes",
    "categories": [
      "Shoes & Accessories > Shoes",
      "Shoes & Accessories > Shoes > Women Shoes"
    ],
    "price": 49.95,
    "quantity": 1,
    "url": "https://example.com/products/23489023",
    "imageUrl": "https://example.com/products/23489023.jpg",
    "currency": "USD",
    "variant": "Striped",
    "color": "Red",
    "size": "US 8",
    "brand": "Nike"
  },
  {
    "id": "123",
    "name": "Another Product"
  }
]

Cart

Represents a shopping cart in a store.

  • Attribute Key - $cart

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
}
fp360.track('AN_EVENT', {
  $cart: {
    id: "5f26d70f-df43-4f7c-b8b9-fe0b2659575f",
    revenue: 73.40,
    discount: 10.00,
    discountCode: "10OFF",
    tax: 5.00,
    shipping: 7.00,
    currency: "USD",
    products: [
      {
        id: "23489023",
        sku: "23489023",
        name: "Red Shoes",
        categories: [
          "Shoes & Accessories > Shoes",
          "Shoes & Accessories > Shoes > Women Shoes"
        ],
        price: 49.95,
        quantity: 1,
        url: "https://example.com/products/23489023",
        imageUrl: "https://example.com/products/23489023.jpg",
        currency: "USD",
        variant: "Striped",
        color: "Red",
        size: "US 8",
        brand: "Nike"
      }
    ],
    location: {
      country: "United States",
      countryCode: "US",
      region: "California",
      city: "Palo Alto",
      postalCode: "94301",
      street: "725 Alma Street",
      text: "725 Alma Street, Palo Alto, CA 94301",
      latitude: 37.44178713736534,
      longitude: -122.16064940120228
    }
  }
}
{
  "id": "5f26d70f-df43-4f7c-b8b9-fe0b2659575f",
  "revenue": 73.40,
  "discount": 10.00,
  "discountCode": "10OFF",
  "tax": 5.00,
  "shipping": 7.00,
  "currency": "USD",
  "products": [
    {
      "id": "23489023",
      "sku": "23489023",
      "name": "Red Shoes",
      "categories": [
        "Shoes & Accessories > Shoes",
        "Shoes & Accessories > Shoes > Women Shoes"
      ],
      "price": 49.95,
      "quantity": 1,
      "url": "https://example.com/products/23489023",
      "imageUrl": "https://example.com/products/23489023.jpg",
      "currency": "USD",
      "variant": "Striped",
      "color": "Red",
      "size": "US 8",
      "brand": "Nike"
    }
  ],
  "location": {
    "country": "United States",
    "countryCode": "US",
    "region": "California",
    "city": "Palo Alto",
    "postalCode": "94301",
    "street": "725 Alma Street",
    "text": "725 Alma Street, Palo Alto, CA 94301",
    "latitude": 37.44178713736534,
    "longitude": -122.16064940120228
  }
}

Order

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

  • Attribute Key - $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
}
fp360.track('AN_EVENT', {
  orderNumber: "34859456045",
  returnReference: "9764383",
  returnReason: "Change of mind",
  revenue: 73.40,
  tax: 5.00,
  currency: "USD",
  cashier: "John",
  products: [
    {
      id: "23489023",
      sku: "23489023",
      name: "Red Shoes",
      categories: [
        "Shoes & Accessories > Shoes",
        "Shoes & Accessories > Shoes > Women Shoes"
      ],
      price: 49.95,
      quantity: 1,
      url: "https://example.com/products/23489023",
      imageUrl: "https://example.com/products/23489023.jpg",
      currency: "USD",
      variant: "Striped",
      color: "Red",
      size: "US 8",
      brand: "Nike"
    }
  ],
  location: {
    id: "243850934",
    name: "Fanplayr HQ",
    country: "United States",
    countryCode: "US",
    region: "California",
    city: "Palo Alto",
    postalCode: "94301",
    street: "725 Alma Street",
    text: "725 Alma Street, Palo Alto, CA 94301",
    latitude: 37.44178713736534,
    longitude: -122.16064940120228
  }
})
{
  "orderNumber": "34859456045",
  "returnReference": "9764383",
  "returnReason": "Change of mind",
  "revenue": 73.40,
  "tax": 5.00,
  "currency": "USD",
  "cashier": "John",
  "products": [
    {
      "id": "23489023",
      "sku": "23489023",
      "name": "Red Shoes",
      "categories": [
        "Shoes & Accessories > Shoes",
        "Shoes & Accessories > Shoes > Women Shoes"
      ],
      "price": 49.95,
      "quantity": 1,
      "url": "https://example.com/products/23489023",
      "imageUrl": "https://example.com/products/23489023.jpg",
      "currency": "USD",
      "variant": "Striped",
      "color": "Red",
      "size": "US 8",
      "brand": "Nike"
    }
  ],
  "location": {
    "id": "243850934",
    "name": "Fanplayr HQ",
    "country": "United States",
    "countryCode": "US",
    "region": "California",
    "city": "Palo Alto",
    "postalCode": "94301",
    "street": "725 Alma Street",
    "text": "725 Alma Street, Palo Alto, CA 94301",
    "latitude": 37.44178713736534,
    "longitude": -122.16064940120228
  }
}

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
}
fp360.track('AN_EVENT', {
  $message: {
    id: "23384534543",
    type: "email",
    recipient: "person@domain.com",
    subject: "You left something in cart!",
    campaign: "Abandoned Cart"
  }
})
{
"id": "23384534543",
"type": "email",
"recipient": "person@domain.com",
"subject": "You left something in cart!",
"campaign": "Abandoned Cart"
}
  • 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
}
fp360.track('AN_EVENT', {
  $location: {
    id: "243850934",
    name: "Fanplayr HQ",
    country: "United States",
    countryCode: "US",
    region: "California",
    city: "Palo Alto",
    postalCode: "94301",
    street: "725 Alma Street",
    text: "725 Alma Street, Palo Alto, CA 94301",
    latitude: 37.44178713736534,
    longitude: -122.16064940120228
  }
})
{
  "id": "243850934",
  "name": "Fanplayr HQ",
  "country": "United States",
  "countryCode": "US",
  "region": "California",
  "city": "Palo Alto",
  "postalCode": "94301",
  "street": "725 Alma Street",
  "text": "725 Alma Street, Palo Alto, CA 94301",
  "latitude": 37.44178713736534,
  "longitude": -122.16064940120228
}

Search

Represents a search performed on an e-commerce website.

  • Attribute Key - $search

interface Search {
  query?: string
}
fp360.track('AN_EVENT', {
    query: "red shoes"
})
{
  "query": "red shoes"
}

Recommendation

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

  • Attribute Key - $recommendation

interface Recommendation {
  id?: string
  products?: Product[]
  model?: string
  productDisplayId?: string
  widgetId?: string
}
fp360.track('AN_EVENT', {
  id: "7812087d-d7ff-46d7-a790-eb60c4bb679f",
  model: "Others You May Like",
  products: [
    {
      id: "23489023",
      sku: "23489023",
      name: "Red Shoes",
      categories: [
        "Shoes & Accessories > Shoes",
        "Shoes & Accessories > Shoes > Women Shoes"
      ],
      price: 49.95,
      quantity: 1,
      url: "https://example.com/products/23489023",
      imageUrl: "https://example.com/products/23489023.jpg",
      currency: "USD",
      variant: "Striped",
      color: "Red",
      size: "US 8",
      brand: "Nike"
    }
  ]
})
{
  "id": "7812087d-d7ff-46d7-a790-eb60c4bb679f",
  "model": "Others You May Like",
  "products": [
    {
      "id": "23489023",
      "sku": "23489023",
      "name": "Red Shoes",
      "categories": [
        "Shoes & Accessories > Shoes",
        "Shoes & Accessories > Shoes > Women Shoes"
      ],
      "price": 49.95,
      "quantity": 1,
      "url": "https://example.com/products/23489023",
      "imageUrl": "https://example.com/products/23489023.jpg",
      "currency": "USD",
      "variant": "Striped",
      "color": "Red",
      "size": "US 8",
      "brand": "Nike"
    }
  ]
}
  • 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
}
fp360.track('AN_EVENT', {
  $targeting: {
    offerId: 'fp-12345',
    experimentId: 'fp-54321',
    actionId: 'fp-92827'
  }
})
{
  "offerId": "fp-12345",
  "experimentId": "fp-54321",
  "actionId": "fp-92827"
}

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
}
fp360.track('AN_EVENT', {
  $widget: {
    id: 'fp-12345',
    name: 'MyWidget',
    variant: 'Variant1',
    breakdpoint: 'p',
    revisionId: 'revision-5',
    action: 'click',
    language: 'en'
  }
})
{
  "id": "fp-12345",
  "name": "MyWidget",
  "variant": "Variant1",
  "breakdpoint": "p",
  "revisionId": "revision-5",
  "action": "click",
  "language": "en"
}

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
}
fp360.track('AN_EVENT', {
  $utm: {
    id: '123xyz',
    medium: 'social',
    source: 'instagram',
    term: 'deal on shirts',
    campaign: 'summer sale 2022',
    content: 'sign up'
  }
})
{
  "id": "123xyz",
  "medium": "social",
  "source": "instagram",
  "term": "deal on shirts",
  "campaign": "summer sale 2022",
  "content": "sign up"
}

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
}
fp360.track('AN_EVENT', {
  $page: {
    name: 'Red Shoes',
    path: '/product/123',
    referrer: 'https://store.com/pages/123',
    title: 'Homepage',
    type: 'Product',
    url: 'https://store.com/product/123'
  }
})
{
  "name": "Red Shoes",
  "path": "/product/123",
  "referrer": "https://store.com/pages/123",
  "title": "Homepage",
  "type": "Product",
  "url": "https://store.com/product/123"
}

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
}
fp360.track('AN_EVENT', {
  $device: {
    browser: 'Firefox',
    browserMajorVersion: 17,
    browserMinorVersion: 3,
    city: 'Palo Alto',
    continent: 'North America',
    country: 'United States',
    countryCode: 'US',
    family: 'Mobile',
    ipAddress: '127.0.0.1',
    latitude: 37.441670,
    longitude: -122.160650,
    os: 'macOS',
    osMajorVersion: 12,
    osMinorVersion: 6,
    postalCode: '94306',
    region: 'California',
    regionCode: 'CA',
    timezone: 'America/Los_Angeles',
    type: 'Mobile',
    userAgent: 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
  }
})
{
  "browser": "Firefox",
  "browserMajorVersion": 17,
  "browserMinorVersion": 3,
  "city": "Palo Alto",
  "continent": "North America",
  "country": "United States",
  "countryCode": "US",
  "family": "Mobile",
  "ipAddress": "127.0.0.1",
  "latitude": 37.44167,
  "longitude": -122.16065,
  "os": "macOS",
  "osMajorVersion": 12,
  "osMinorVersion": 6,
  "postalCode": "94306",
  "region": "California",
  "regionCode": "CA",
  "timezone": "America/Los_Angeles",
  "type": "Mobile",
  "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
}

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
}
fp360.track('AN_EVENT', {
  $session: {
    domain: 'demo.fanplayr.com',
    durationSecs: 20,
    endTime: '2000-01-01 10:30:00',
    id: "asdfasdfasdf"
    orderCount: 0,
    pageCount: 5,
    startTime: '2000-01-01 10:29:40'
  }
})
{
    "domain": "demo.fanplayr.com",
    "durationSecs": 20,
    "endTime": "2000-01-01 10:30:00",
    "id": "asdfasdfasdf"
    "orderCount": 0,
    "pageCount": 5,
    "startTime": "2000-01-01 10:29:40"
}

Represents a group of .

products -

products -

location -

products -

location -

billingLocation -

shippingLocation -

id - a unique identifier for this message that remains the same between message events such as or .

products -

👩‍💻
Products
Product
Product
Location
Product
Location
Location
Location
Product
Insights
Semantic Events
Data Dictionary
Order Completed
Message Sent
Message Delivered