$name, 'count' => (int) $count, 'key' => (bool) $is_key, 'suggested' => self::suggested( $name, $is_key ), ); } /** * Whether to put this event forward as a likely conversion. * * A suggestion only draws the eye; it never ticks anything. * * @param string $name Event name. * @param bool $is_key Whether GA4 marks it as a key event. * @return bool */ private static function suggested( $name, $is_key ) { if ( $is_key ) { return true; } /** * Filters the event names treated as likely conversions in the site editor. * * @param string[] $names Event names. */ $names = (array) apply_filters( 'turtlereport_conversion_event_names', self::LIKELY ); foreach ( $names as $likely ) { if ( 0 === strcasecmp( $name, (string) $likely ) ) { return true; } } return (bool) preg_match( self::LIKELY_PATTERN, $name ); } }