PelcroPaywallMatch

Fired when content matches a paywall rule

Overview

Fired when the current page content matches a paywall rule. This event fires before the paywall decision is made (displayed or not displayed).


Triggered By

  • Paywall initialization evaluating page content against rules

Event Detail

The event.detail object contains the visit record:

PropertyTypeDescription
visitsnumberNumber of visits to paywalled content
limitnumberConfigured visit limit

Example

document.addEventListener('PelcroPaywallMatch', (event) => {
  const record = event.detail;

  console.log(`Content matched paywall rule`);
  console.log(`Visits: ${record.visits} / ${record.limit}`);

  // Track content match
  analytics.track('Paywall Content Match', {
    pageUrl: window.location.href,
    visits: record.visits
  });
});

Event Sequence

When content is paywalled, events fire in this order:

  1. PelcroPaywallMatch - Content matches a rule
  2. Then either:
    • PelcroPaywallDisplayed - User doesn't have access
    • PelcroPaywallNotDisplayed - User has access

Related