PelcroPaywallDisplayed

Fired when paywall is displayed

Overview

Fired when a paywall modal or restriction is displayed to the user. This indicates the user does not have access to the content.


Triggered By

  • Automatic paywall initialization during boot
  • Manual paywall trigger via Pelcro.paywall.displayPaywall()
  • Content matching a paywall rule

Event Detail

The event.detail object contains information about the displayed paywall:

PropertyTypeDescription
paywallobjectThe paywall configuration
ruleobjectThe matched paywall rule

Example

document.addEventListener('PelcroPaywallDisplayed', (event) => {
  console.log('Paywall displayed');

  // Track paywall impression
  analytics.track('Paywall Displayed', {
    pageUrl: window.location.href
  });

  // Hide premium content indicators
  hidePremiumContentPreview();
});

Related