*/ public static function labels(): array { return array( self::DIRECT => __( 'Direct', 'ghizo-attribution-tracker' ), self::ORGANIC_SEARCH => __( 'Organic Search', 'ghizo-attribution-tracker' ), self::ORGANIC_SOCIAL => __( 'Organic Social', 'ghizo-attribution-tracker' ), self::PAID_SEARCH => __( 'Paid Search', 'ghizo-attribution-tracker' ), self::PAID_SOCIAL => __( 'Paid Social', 'ghizo-attribution-tracker' ), self::REFERRAL => __( 'Referral', 'ghizo-attribution-tracker' ), self::EMAIL => __( 'Email', 'ghizo-attribution-tracker' ), self::OTHER => __( 'Other Campaign', 'ghizo-attribution-tracker' ), ); } /** * Look up a channel label, falling back to the raw value. */ public static function label( string $channel ): string { return self::labels()[ $channel ] ?? $channel; } /** * The rule set handed to the capture script. * * @return array */ public static function rules(): array { $rules = array( 'search' => array( 'google', 'bing', 'yahoo', 'duckduckgo', 'baidu', 'yandex', 'ecosia', 'startpage', 'qwant', 'brave', 'aol', 'ask.com', 'perplexity', ), 'social' => array( 'facebook', 'fb.com', 'instagram', 'linkedin', 'lnkd.in', 'twitter', 'x.com', 't.co', 'pinterest', 'reddit', 'tiktok', 'youtube', 'youtu.be', 'snapchat', 'threads', 'tumblr', 'quora', 'vk.com', 'whatsapp', 'telegram', 't.me', ), 'paid_mediums' => array( 'cpc', 'ppc', 'cpm', 'cpv', 'cpa', 'paid', 'paidsearch', 'paid-search', 'paid_search', 'display', 'banner', 'retargeting', 'remarketing', ), 'social_mediums' => array( 'social', 'paid-social', 'paidsocial', 'paid_social', 'social-paid', 'social_paid', ), 'email_mediums' => array( 'email', 'e-mail', 'mail', 'newsletter', ), 'organic_mediums' => array( 'organic', 'seo', ), 'referral_mediums' => array( 'referral', 'referrer', 'affiliate', 'partner', ), 'click_id_channels' => array( 'gclid' => self::PAID_SEARCH, 'gbraid' => self::PAID_SEARCH, 'wbraid' => self::PAID_SEARCH, 'msclkid' => self::PAID_SEARCH, 'fbclid' => self::PAID_SOCIAL, ), ); /** * Filters the channel classification rule set. * * @param array $rules Rule set passed to the capture script. */ return apply_filters( 'wpat_channel_rules', $rules ); } }