Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plans overhaul: Add Google Analytics for Starter #63766

Merged
merged 3 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/blocks/product-purchase-features-list/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export class ProductPurchaseFeaturesList extends Component {
return (
<Fragment>
<CustomDomain selectedSite={ selectedSite } hasDomainCredit={ planHasDomainCredit } />
<GoogleAnalyticsStats selectedSite={ selectedSite } />
<SiteActivity />
<MobileApps onClick={ this.handleMobileAppsClick } />
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { localize } from 'i18n-calypso';
import { find } from 'lodash';
import PropTypes from 'prop-types';
import earnImage from 'calypso/assets/images/customer-home/illustration--task-earn.svg';
import analyticsImage from 'calypso/assets/images/illustrations/google-analytics.svg';
import PurchaseDetail from 'calypso/components/purchase-detail';
import CustomDomainPurchaseDetail from './custom-domain-purchase-detail';
import GoogleAppsDetails from './google-apps-details';
Expand Down Expand Up @@ -30,6 +31,16 @@ const StarterPlanDetails = ( { translate, selectedSite, sitePlans, purchases } )
buttonText={ translate( 'Start Earning' ) }
href={ '/earn/' + selectedSite.slug }
/>

<PurchaseDetail
icon={ <img alt="" src={ analyticsImage } /> }
title={ translate( 'Connect to Google Analytics' ) }
description={ translate(
"Complement WordPress.com's stats with Google's in-depth look at your visitors and traffic patterns."
) }
buttonText={ translate( 'Connect Google Analytics' ) }
href={ '/settings/analytics/' + selectedSite.slug }
/>
</div>
);
};
Expand Down
37 changes: 37 additions & 0 deletions client/my-sites/plans-comparison/plans-comparison-features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
FEATURE_TITAN_EMAIL,
FEATURE_MONETISE,
FEATURE_JETPACK_ESSENTIAL,
FEATURE_GOOGLE_ANALYTICS,
} from '@automattic/calypso-products';
import { Gridicon } from '@automattic/components';
import { translate, numberFormat } from 'i18n-calypso';
Expand Down Expand Up @@ -374,6 +375,42 @@ export const planComparisonFeatures: PlanComparisonFeature[] = [
} );
},
},
{
get title() {
return translate( 'Google Analytics integration' );
},
get description() {
return translate(
"Track your site's stats with Google Analytics for a deeper understanding of your visitors and customers."
);
},
features: [ FEATURE_GOOGLE_ANALYTICS ],
getCellText: ( feature, isMobile = false ) => {
if ( ! isMobile ) {
if ( feature ) {
return (
<>
<Gridicon icon="checkmark" />
{ translate( 'Included' ) }
</>
);
}

return (
<>
<Gridicon icon="cross" />
{ translate( 'Not included' ) }
</>
);
}

return feature
? translate( 'Google Analytics integration' )
: translate( 'Google Analytics integration is {{strong}}not{{/strong}} included', {
components: { strong: <strong /> },
} );
},
},
{
get title() {
return translate( 'Remove ads' );
Expand Down
2 changes: 2 additions & 0 deletions packages/calypso-products/src/plans-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,7 @@ PLANS_LIST[ PLAN_WPCOM_STARTER ] = {
FEATURE_CUSTOM_DOMAIN,
FEATURE_UNLIMITED_ADMINS,
FEATURE_6GB_STORAGE,
FEATURE_GOOGLE_ANALYTICS,
],
};

Expand Down Expand Up @@ -1638,6 +1639,7 @@ PLANS_LIST[ PLAN_WPCOM_PRO ] = {
FEATURE_JETPACK_ESSENTIAL,
FEATURE_SIMPLE_PAYMENTS,
FEATURE_WORDADS_INSTANT,
FEATURE_GOOGLE_ANALYTICS,
],
getIncludedFeatures: () => [
FEATURE_ADVANCED_DESIGN,
Expand Down