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

Fix UTM card learn more link #96651

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { localizeUrl } from '@automattic/i18n-utils';
import clsx from 'clsx';
import { useTranslate } from 'i18n-calypso';
import React from 'react';
import InlineSupportLink from 'calypso/components/inline-support-link';
import { SUPPORT_URL, INSIGHTS_SUPPORT_URL } from 'calypso/my-sites/stats/const';
import { useSelector } from 'calypso/state';
import getIsSiteWPCOM from 'calypso/state/selectors/is-site-wpcom';
Expand Down Expand Up @@ -54,29 +53,27 @@ const insightsSupportLinkWithAnchor = ( anchor: string ) => {
);
};

const utmLearnMoreLink = ( isOdysseyStats: boolean ) => {
return isOdysseyStats ? (
const utmLearnMoreLink = () => {
return (
<a
href="https://jetpack.com/redirect/?source=jetpack-stats-learn-more-about-new-pricing"
href="https://jetpack.com/redirect/?source=jetpack-stats-learn-more-about-utm-url-builder"
target="_blank"
rel="noopenner noreferrer"
/>
) : (
<InlineSupportLink supportContext="utm-upsell-overlay" showIcon={ false } />
);
};

const useUpsellCopy = ( statType: string, isOdysseyStats: boolean ) => {
const useUpsellCopy = ( statType: string ) => {
const translate = useTranslate();
switch ( statType ) {
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. {{link}}Learn more{{/link}}.',
'Generate UTM parameters and track your campaign performance data. {{link}}Learn more{{/link}}',
{
components: {
link: utmLearnMoreLink( isOdysseyStats ),
link: utmLearnMoreLink(),
},
}
);
Expand Down Expand Up @@ -164,7 +161,7 @@ const useUpsellCopy = ( statType: string, isOdysseyStats: boolean ) => {
const StatsCardUpsellJetpack: React.FC< Props > = ( { className, siteId, statType } ) => {
const translate = useTranslate();
const isOdysseyStats = config.isEnabled( 'is_running_in_jetpack_site' );
const copyText = useUpsellCopy( statType, isOdysseyStats );
const copyText = useUpsellCopy( statType );

const siteSlug = useSelector( ( state ) => getSiteSlug( state, siteId ) );
const isWPCOMSite = useSelector( ( state ) => siteId && getIsSiteWPCOM( state, siteId ) );
Expand Down
Loading