Documentation
Documentation (JA)
Documentation (JA)
  • Documentation
  • Products
    • Fanplayr Targeting Portal
    • Fanplayr 360
    • PrivacyID
    • SiteSpeed
  • Features
    • Merchandising
    • Security
    • SMS
    • Web Push Notifications
      • Direct Integration Guide
      • Popup Integration Guide
      • Imaging Sizing Guide
    • Data Residency
  • Fanplayr Targeting
    • E-Commerce Integrations
      • BigCommerce
      • CommerceV3
      • Magento 1
        • Getting Started
        • Configuration
      • Magento 2
      • Miva Merchant
      • PrestaShop
      • Salesforce Commerce Cloud
      • Shopify
      • Volusion
      • VTEX
      • VTEX IO
    • Custom Integration
      • Page tracking
        • Apply to cart
        • Session offers
      • Order tracking
      • Data types
        • CartAction
        • Product
      • Data Layer API
      • Enhanced user identification
        • Manual Integration
      • Segmentation as a service
      • Lazy loading
      • Page caching
      • Tag managers
      • Single page apps
      • Custom data for verticals
        • Travel
    • Pixel Integration
    • ESP Integrations
    • Link Decoration
    • User Management
      • User Identity
      • User Properties
  • Other
    • CSP & Domains
Powered by GitBook
On this page
  • Properties
  • id
  • qty
  • sku
  • name
  • price
  • brands
  • categories
  • catId
  • catName
  • url
  • image
  • Product merging strategy

Was this helpful?

  1. Fanplayr Targeting
  2. Custom Integration
  3. Data types

Product

The product object represents a product line item that is in the cart or that has been purchased in an order.

PreviousCartActionNextData Layer API

Was this helpful?

Properties

id

  • Type: string

  • Required

A unique product identifier. Used to differentiate products in the cart or order.

Some shopping carts use the same identifier or SKU for different variants of a product. If multiple products appear with the same id, Fanplayr will consider them identical and merge their quantities together. This can lead to undesired data being tracked so it is important that you provide a unique id for each distinct product being tracked.

See:

qty

  • Type: integer

  • Required

The quantity of the line item in the cart or order.

sku

  • Type: string

  • Required

The product SKU. This may be the same as id, but is also made available as a segmentation option.

name

  • Type: string

  • Required

The product name. E.g. "Red Shoes".

price

  • Type: float

  • Required

The unit price of the product visible to the user.

For carts that implement a base price and a discounted/sale price, use the discounted price if it is the price shown to users when they add the product to the cart.

brands

  • Type: string[]

An array of brand names associated with the product.

Example: ["Nike"]

categories

  • Type: string[]

An array of category names associated with the product.

Example: ["Women", "Shoes"]

catId

  • Type: string

The ID of the category that this product belongs to. Multiple categories can be specified by separating them by commas. E.g. "32,762".

catName

  • Type: string

The name of the category that this product belongs to. Multiple categories can be specified by separating them by commas. E.g. "Hardwood floors,Benches".

url

  • Type: string

The URL of the page that displays full details of the product.

image

  • Type: string

The URL of the product image.

Product merging strategy

Fanplayr will not be able to track these as separate products as they share the same id:

[
  {
    id: 'aygwi',
    sku: 'aygwi',
    name: 'Crew Tee (Black)',
    price: 10.00,
    qty: 1
  },
  {
    id: 'aygwi',
    sku: 'aygwi',
    name: 'Crew Tee (White)',
    price: 15.00,
    qty: 1
  }
]

Instead, Fanplayr will see these as a single product because it merges quantities of products with the same id. This can lead to incorrect calculation of product prices and quantities.

[
  {
    id: 'aygwi',
    sku: 'aygwi',
    name: 'Crew Tee (Black)',
    price: 10.00,
    qty: 2
  }
]

This can be avoided by providing unique identifiers for products:

[
  {
    id: 'aygwi-black',
    sku: 'aygwi',
    name: 'Crew Tee (Black)',
    price: 10.00,
    qty: 1
  },
  {
    id: 'aygwi-white',
    sku: 'aygwi',
    name: 'Crew Tee (White)',
    price: 15.00,
    qty: 1
  }
]

Scope: Only applies to Product objects used in Shopping Cart and Order Confirmation pages. For Product pages, use the property.

Scope: Only applies to Product objects used in Shopping Cart and Order Confirmation pages. For Product pages, use the property.

Deprecated. Use instead.

Deprecated. Use instead.

Product merging strategy
categories
categories
page-level brands
page-level categories