Skip to content

Commit

Permalink
Add learn more link.
Browse files Browse the repository at this point in the history
  • Loading branch information
zutigrm committed Jul 3, 2024
1 parent 487efc3 commit 0be47cd
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions assets/js/modules/analytics-4/components/settings/SettingsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import PropTypes from 'prop-types';
/**
* WordPress dependencies
*/
import { Fragment } from '@wordpress/element';
import { Fragment, createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
Expand All @@ -39,12 +39,20 @@ import EntityOwnershipChangeNotice from '../../../../components/settings/EntityO
import { isValidAccountID } from '../../utils/validation';
import ConversionTrackingToggle from '../../../../components/conversion-tracking/ConversionTrackingToggle';
import { useFeature } from '../../../../hooks/useFeature';
import { CORE_SITE } from '../../../../googlesitekit/datastore/site/constants';
import Link from '../../../../components/Link';

export default function SettingsForm( { hasModuleAccess } ) {
const accountID = useSelect( ( select ) =>
select( MODULES_ANALYTICS_4 ).getAccountID()
);

const conversionTrackingDocumentationURL = useSelect( ( select ) =>
select( CORE_SITE ).getDocumentationLinkURL(
'enhanced-conversion-tracking'
)
);

const iceEnabled = useFeature( 'conversionInfra' );

return (
Expand All @@ -59,9 +67,23 @@ export default function SettingsForm( { hasModuleAccess } ) {

{ iceEnabled && (
<ConversionTrackingToggle>
{ __(
'Conversion tracking is used for tracking additional conversion-related events via Analytics',
'google-site-kit'
{ createInterpolateElement(
__(
'Conversion tracking is used for tracking additional conversion-related events via Analytics. <a>Learn more</a>',
'google-site-kit'
),
{
a: (
<Link
href={ conversionTrackingDocumentationURL }
external
aria-label={ __(
'Learn more about conversion tracking',
'google-site-kit'
) }
/>
),
}
) }
</ConversionTrackingToggle>
) }
Expand Down

0 comments on commit 0be47cd

Please sign in to comment.