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

Was this helpful?

  1. Fanplayr Targeting
  2. Custom Integration

Page caching

If you have your store caches page requests then you may have to make a second call to Fanplayr to get the correct data for the specific user. Items such as page type, category etc. can be send through with this cached request, although data such as cart items and subtotals may change with each request. Both PrestaShop and Magento use Full Page Caching and our implementations of extensions for these shops do a request to a local service which sends back the real embed code. For example:

(function(d, w, s) {
  var js = d.createElement(s), fjs  = d.getElementsByTagName(s)[0]; js.async = true;
  js.src   = 'https://mystore.com/fanplayr/ajax/getEmbedJs/'
    + '?pageType=home&productId=&categoryId=&productName=&categoryName=&'
    + (new Date().getTime());
  fjs.parentNode.insertBefore(js, fjs);
})(document, window, 'script');

Note that page type, product ID, category ID, product name and category name are sent through on this request and a OK to be cached as they do not change with each request.

PreviousLazy loadingNextTag managers

Was this helpful?