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
  • Examples
  • Tracking additional page properties

Was this helpful?

  1. Fanplayr Targeting
  2. Custom Integration

Data Layer API

An API for interacting with the Fanplayr JavaScript library.

PreviousProductNextEnhanced user identification

Was this helpful?

Fanplayr's data API is a simple javascript array which can be used to store and send information to the Fanplayr Platform. It can be used alongside the standard Fanplayr integration to track additional information in your store.

Note: The array must be defined and populated with values BEFORE the standard is executed.

Examples

Tracking additional page properties

In the following example, two additional properties named brand and color are captured along with the standard information Fanplayr tracks for page views.

The special _type property informs Fanplayr that the information should be stored with the page view.

<!-- Before user tracking snippet -->
<script>
window.fanplayr_api = [{
  "_type": "page.data",
  "brand": "Super",
  "color": "red"
}];
</script>
Page tracking snippet