diff --git a/client/my-sites/stats/constants.ts b/client/my-sites/stats/constants.ts index 7e753d75d6d37..b77730a3e2f78 100644 --- a/client/my-sites/stats/constants.ts +++ b/client/my-sites/stats/constants.ts @@ -26,6 +26,7 @@ export const STAT_TYPE_CLICKS = 'statsClicks'; export const STAT_TYPE_COMMENT_FOLLOWERS = 'statsCommentFollowers'; export const STAT_TYPE_COMMENTS = 'statsComments'; export const STAT_TYPE_COUNTRY_VIEWS = 'statsCountryViews'; +export const STAT_TYPE_FILE_DOWNLOADS = 'statsFileDownloads'; export const STAT_TYPE_FOLLOWERS = 'statsFollowers'; export const STAT_TYPE_INSIGHTS_ALL_TIME_STATS = 'statsInsightsAllTimeStats'; export const STAT_TYPE_INSIGHTS_MOST_POPULAR_TIME = 'statsInsightsMostPopularTime'; diff --git a/client/my-sites/stats/hooks/use-should-gate-stats.ts b/client/my-sites/stats/hooks/use-should-gate-stats.ts index 601c6f94119e2..59904533e7001 100644 --- a/client/my-sites/stats/hooks/use-should-gate-stats.ts +++ b/client/my-sites/stats/hooks/use-should-gate-stats.ts @@ -18,6 +18,7 @@ import { STAT_TYPE_REFERRERS, STAT_TYPE_COUNTRY_VIEWS, STAT_TYPE_CLICKS, + STAT_TYPE_FILE_DOWNLOADS, STAT_TYPE_TOP_AUTHORS, STAT_TYPE_SEARCH_TERMS, STAT_TYPE_VIDEO_PLAYS, @@ -104,8 +105,11 @@ const gatedStats = [ STATS_TYPE_DEVICE_STATS, // Paid Stats + STAT_TYPE_TOP_POSTS, STAT_TYPE_REFERRERS, + STAT_TYPE_COUNTRY_VIEWS, STAT_TYPE_CLICKS, + STAT_TYPE_FILE_DOWNLOADS, ...defaultDateControlGates, STATS_FEATURE_DOWNLOAD_CSV, STATS_FEATURE_INTERVAL_DROPDOWN_WEEK, @@ -253,6 +257,15 @@ export const shouldGateStats = ( state: object, siteId: number | null, statType: return basicStats.includes( statType ); } + // If v3 is not enabled do not directly gate top posts, file downloads, and country views. + // We could remove this check once v3 is enabled. + if ( + ! isEnabled( 'stats/paid-wpcom-v3' ) && + [ STAT_TYPE_TOP_POSTS, STAT_TYPE_FILE_DOWNLOADS, STAT_TYPE_COUNTRY_VIEWS ].includes( statType ) + ) { + return false; + } + // All other sites get gated to 7 days + paywall upsell return gatedStats.includes( statType ); }; diff --git a/client/my-sites/stats/stats-card-upsell/stats-card-upsell-wpcom.tsx b/client/my-sites/stats/stats-card-upsell/stats-card-upsell-wpcom.tsx index 0c627ef406066..cf78ab8978d71 100644 --- a/client/my-sites/stats/stats-card-upsell/stats-card-upsell-wpcom.tsx +++ b/client/my-sites/stats/stats-card-upsell/stats-card-upsell-wpcom.tsx @@ -7,9 +7,12 @@ import { STATS_FEATURE_UTM_STATS, STATS_TYPE_DEVICE_STATS, STAT_TYPE_CLICKS, + STAT_TYPE_COUNTRY_VIEWS, + STAT_TYPE_FILE_DOWNLOADS, STAT_TYPE_REFERRERS, STAT_TYPE_SEARCH_TERMS, STAT_TYPE_TOP_AUTHORS, + STAT_TYPE_TOP_POSTS, STAT_TYPE_VIDEO_PLAYS, } from '../constants'; import StatsCardUpsellOverlay from './stats-card-upsell-overlay'; @@ -19,22 +22,28 @@ import './style.scss'; const getUpsellCopy = ( statType: string ) => { switch ( statType ) { - case STAT_TYPE_REFERRERS: - return translate( - 'Find out where your visitors come from to optimize your content strategy.' - ); case STAT_TYPE_CLICKS: return translate( 'Learn what external links your visitors click on your site to reveal their areas of interest.' ); + case STAT_TYPE_COUNTRY_VIEWS: + return translate( 'See where your visitors come from.' ); + case STAT_TYPE_FILE_DOWNLOADS: + return translate( 'Monitor your file downloads engagement.' ); + case STAT_TYPE_REFERRERS: + return translate( + 'Find out where your visitors come from to optimize your content strategy.' + ); case STAT_TYPE_SEARCH_TERMS: return translate( 'Discover the terms and phrases your visitors use to find your site.' ); case STAT_TYPE_TOP_AUTHORS: return translate( 'Identify your audience’s favorite writers and perspectives.' ); - case STATS_FEATURE_DATE_CONTROL: - return translate( 'Compare different time periods to analyze your site’s growth.' ); + case STAT_TYPE_TOP_POSTS: + return translate( 'Track posts and pages views.' ); case STAT_TYPE_VIDEO_PLAYS: return translate( 'Discover your most popular videos and find out how they performed.' ); + case STATS_FEATURE_DATE_CONTROL: + return translate( 'Compare different time periods to analyze your site’s growth.' ); case STATS_FEATURE_UTM_STATS: return translate( 'Generate UTM parameters and track your campaign performance data.' ); case STATS_TYPE_DEVICE_STATS: