__('Screen shown', 'wconvert'), self::ScreenAdvanced => __('Screen completed', 'wconvert'), self::ScreenSkipped => __('Screen skipped', 'wconvert'), self::ScreenDismissed => __('Screen dismissed', 'wconvert'), self::Impression => __('Impressions', 'wconvert'), self::Conversion => __('Conversions', 'wconvert'), self::ProductShown => __('Product cards shown', 'wconvert'), self::ProductClick => __('Product links clicked', 'wconvert'), self::CartAddition => __('Items added to basket', 'wconvert'), self::Capture => __('Captured submissions', 'wconvert'), self::ResultClick => __('Result link clicks', 'wconvert'), self::Dismiss => __('Dismissals', 'wconvert'), self::LeadMagnetDelivered => __('Emails accepted for sending', 'wconvert'), }; } /** * The kind a *browser* may assert, or null. * * The beacon endpoint is public and * unauthenticated by necessity — a nonce baked into a page the full-page * cache serves byte-identically to everyone authenticates nothing — so the * honest limit on it is what a browser could possibly know. It saw the * Optin, it converted, it closed it. It cannot have watched an email send * (ADR 0019, ADR 0020). */ public static function fromBeacon(string $value): ?self { $kind = self::tryFrom($value); return in_array($kind, [self::LeadMagnetDelivered, self::Capture, self::CartAddition, self::ProductShown, self::ProductClick], true) ? null : $kind; } }