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

Feature/2460 google ads value prop #2635

Draft
wants to merge 104 commits into
base: feature/2459-campaign-creation-flow
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
5c62798
Swap performance cards.
asvinb Aug 23, 2024
0423844
Merge pull request #2564 from woocommerce/update/2537-swap-dashboard-…
joemcgill Sep 4, 2024
a37c974
Tweak WP Proxy Response to force the types of the fields
puntope Sep 25, 2024
7cb7531
Symlink WC instead of moving the WC folder
jorgemd24 Sep 25, 2024
2583950
Fix mixed spacing
jorgemd24 Sep 26, 2024
24c212e
Merge pull request #2625 from woocommerce/dev/fix-bluebird-dependency…
jorgemd24 Sep 26, 2024
502a89e
Merge branch 'develop' into fix/api-pull-type-prices
puntope Sep 27, 2024
c93a26a
Merge pull request #2624 from woocommerce/fix/api-pull-type-prices
puntope Sep 27, 2024
ac6e716
Merge branch 'develop' into feature/2460-google-ads-value-prop
joemcgill Sep 30, 2024
57b4adb
intial commit
kt-12 Oct 10, 2024
3922ab1
CreateCampaignNotice component
kt-12 Oct 12, 2024
711160d
Add CreateCampaignNotice to the product-feed page
kt-12 Oct 12, 2024
656c4a8
check for google ads connection
kt-12 Oct 12, 2024
0170b7d
Get Campaign Notice on prodict feed E2E
kt-12 Oct 14, 2024
7b963a4
fix bug
kt-12 Oct 14, 2024
cefcd7a
fix e2e account connection
kt-12 Oct 14, 2024
25365e5
add more spaces.
kt-12 Oct 14, 2024
a3b00cb
remove unused dashboard variable.
kt-12 Oct 14, 2024
df22e4a
remove incorrect comment
kt-12 Oct 14, 2024
15123b0
remove unused fulfill's
kt-12 Oct 14, 2024
120d5fd
Avoid querying campaigns in useAdsCampaigns before connection
joemcgill Oct 15, 2024
922edb4
Fix E2E tests
joemcgill Oct 15, 2024
c19de71
replace child with text content
kt-12 Oct 18, 2024
1536e4b
simplyfy logic
kt-12 Oct 18, 2024
4631978
simplify logic
kt-12 Oct 18, 2024
6181299
slight rearragment
kt-12 Oct 18, 2024
c65f071
change variable name
kt-12 Oct 18, 2024
59ac898
remove alaising
kt-12 Oct 18, 2024
1b739a6
remove class name
kt-12 Oct 18, 2024
6d90bb9
fix jest error
kt-12 Oct 21, 2024
199675d
Fix notice styling
joemcgill Oct 21, 2024
71a823c
Fix CSS lint issues
joemcgill Oct 21, 2024
80016a2
Review styles.
asvinb Oct 22, 2024
3553804
Merge branch 'feature/2459-campaign-creation-flow' into feature/2460-…
kt-12 Oct 22, 2024
d544759
remove free credits
kt-12 Oct 22, 2024
62d124c
add paid-features.js
kt-12 Oct 22, 2024
19ef7b1
remove translations
kt-12 Oct 22, 2024
90ea27a
e2e
kt-12 Oct 22, 2024
2a7af58
style fixes and e2e
kt-12 Oct 22, 2024
1ed56b8
fix e2e button clicking
kt-12 Oct 22, 2024
cd2521c
fix old e2e
kt-12 Oct 22, 2024
81aba99
Merge branch 'feature/2460-google-ads-value-prop' into feature/2539-s…
kt-12 Oct 23, 2024
05aecee
Merge branch 'feature/2539-show-promo' of https://github.com/woocomme…
kt-12 Oct 23, 2024
bd77902
Merge branch 'feature/2459-campaign-creation-flow' into feature/2460-…
joemcgill Oct 24, 2024
165543c
Convert notice to a Flex component in the CardFooter
joemcgill Oct 24, 2024
51dfbca
this could be null so return []
kt-12 Oct 25, 2024
3f824c0
update condition here
kt-12 Oct 25, 2024
660ad11
only fetch campaigns from fully connected account
kt-12 Oct 25, 2024
052a386
match loading attributes with that of google ads account api status
kt-12 Oct 25, 2024
77dd887
remove button click
kt-12 Oct 25, 2024
30237f3
revert back changes to useAdsCampaigns
kt-12 Oct 28, 2024
65972ac
fix e2e
kt-12 Oct 28, 2024
d8cb4cc
address review feedback.
kt-12 Oct 28, 2024
cd58bca
doc updated.
kt-12 Oct 28, 2024
2954cf6
update e2e
kt-12 Oct 30, 2024
09146cf
add page reload
kt-12 Oct 30, 2024
c1bfc5b
remove unused variable.
kt-12 Oct 30, 2024
33ebb24
remove unused css
kt-12 Oct 30, 2024
616756f
remove unused mock. use page.goto instead or reload and rearrage tests
kt-12 Oct 31, 2024
e7a0f64
Merge pull request #2641 from woocommerce/feature/2539-show-promo
joemcgill Oct 31, 2024
cfa279c
Update js/src/dashboard/summary-section/paid-features/free-ad-credit.js
kt-12 Nov 1, 2024
96e4162
Update js/src/dashboard/summary-section/paid-features/free-ad-credit.js
kt-12 Nov 1, 2024
d5d1d2f
remove usage of sections, fix styling
kt-12 Nov 1, 2024
e4fa585
Merge branch 'feature/2538-performance-card-sep' of https://github.co…
kt-12 Nov 1, 2024
d043e81
remove margin
kt-12 Nov 1, 2024
b77f18e
seperate file for paid-features test
kt-12 Nov 1, 2024
cd7ec9f
fix button name
kt-12 Nov 1, 2024
6fe5003
update variable names and cleanup
kt-12 Nov 1, 2024
51d5187
cleanup
kt-12 Nov 1, 2024
ccc7edc
Merge branch 'feature/2460-google-ads-value-prop' into feature/2538-p…
kt-12 Nov 1, 2024
2d77db8
check when ads complete is set
kt-12 Nov 1, 2024
0fcba0f
change variable name
kt-12 Nov 1, 2024
38318b2
avoide flakyness
kt-12 Nov 1, 2024
2297982
change variable name
kt-12 Nov 4, 2024
f8f9c4a
remove additional assignement
kt-12 Nov 4, 2024
d7d17ad
style changes
kt-12 Nov 4, 2024
311a850
update E2E
kt-12 Nov 4, 2024
f899c31
jest update
kt-12 Nov 5, 2024
ff4376e
fix review changes.
kt-12 Nov 5, 2024
f46e880
fix jest
kt-12 Nov 5, 2024
f0ab0f6
fix unused variable
kt-12 Nov 5, 2024
9caf01d
remove only
kt-12 Nov 5, 2024
5a27b75
fix jest
kt-12 Nov 6, 2024
f8c3339
remove unnecessary typecasting.
kt-12 Nov 6, 2024
0e80569
css changes
kt-12 Nov 6, 2024
64eaab6
div -> component
kt-12 Nov 6, 2024
b0c712e
Style fixes
joemcgill Nov 7, 2024
64eb3b4
More style adjustments
joemcgill Nov 7, 2024
d1fe9eb
add new Fulfill for ad report.
kt-12 Nov 7, 2024
c7bbc72
check for text content in Summary+ mock add empty campaign.
kt-12 Nov 7, 2024
0f809f3
update variable name.
kt-12 Nov 7, 2024
c724767
remove margin
kt-12 Nov 7, 2024
1a516c7
remove size attribute.
kt-12 Nov 7, 2024
2c3f089
Merge pull request #2650 from woocommerce/feature/2538-performance-ca…
joemcgill Nov 7, 2024
d38b1ec
Remove 'Paid' from ads creation
joemcgill Nov 11, 2024
4ac7c89
Update E2E test description
joemcgill Nov 12, 2024
3a36464
Update src/Tracking/README.md
joemcgill Nov 12, 2024
fa1f5ed
Remove additional instances of the word 'paid' with Ads
joemcgill Nov 14, 2024
cef1b83
Copy tweak
joemcgill Nov 14, 2024
9b71ea6
Results typically improve with time
joemcgill Nov 17, 2024
933e5b4
Skip ads creation
joemcgill Nov 17, 2024
a70da30
Fix the issue that E2E test can't log in to wp-admin.
eason9487 Nov 11, 2024
10dc1c9
Reach more shoppers with Google Ads
joemcgill Nov 17, 2024
98c62a5
Merge pull request #2672 from woocommerce/update/2664-remove-paid-word
joemcgill Nov 17, 2024
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
6 changes: 3 additions & 3 deletions bin/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ install_wc() {
if [ ! -f "$WC_VERSION_FILE" ]; then
# set up testing suite
rm -rf "$WC_DIR"
mkdir -p "$WC_DIR"
echo "Installing WooCommerce ($WC_VERSION)."
# Grab the necessary plugins.
WC_TMPDIR="${TMPDIR}/woocommerce-${WC_VERSION}"
rm -rf "${WC_TMPDIR}"
git clone --quiet --depth=1 --branch="${WC_VERSION}" https://github.com/woocommerce/woocommerce.git "${WC_TMPDIR}"
mv "${WC_TMPDIR}"/plugins/woocommerce/* "$WC_DIR"
touch "$WC_VERSION_FILE"

ln -s "${WC_TMPDIR}"/plugins/woocommerce "$WC_DIR"
touch "$WC_VERSION_FILE"

# Install composer for WooCommerce
cd "${WC_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/free-ad-credit/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

svg {
flex: 0 0 auto;
fill: #007017;
fill: $gla-color-green;
}

&__title {
Expand Down
6 changes: 3 additions & 3 deletions js/src/components/paid-ads/add-paid-campaign-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import { getCreateCampaignUrl } from '.~/utils/urls';
import { recordGlaEvent } from '.~/utils/tracks';

/**
* "Add paid campaign" button is clicked.
* "Add campaign" button is clicked.
*
* @event gla_add_paid_campaign_clicked
* @property {string} context Indicate the place where the button is located.
* @property {string} href Indicate the destination where the users is directed to, e.g. `'/google/setup-ads'`.
*/

/**
* Renders an AppButton with the text "Add Paid Campaign".
* Renders an AppButton with the text "Add campaign".
* Clicking on the button will call `recordGlaEvent` and
* redirect to Setup MC or Create New Campaign depending on
* whether the users have completed ads setup or not.
Expand Down Expand Up @@ -68,7 +68,7 @@ const AddPaidCampaignButton = ( props ) => {

return (
<AppButton isSmall isSecondary onClick={ handleClick } { ...rest }>
{ children || __( 'Add paid campaign', 'google-listings-and-ads' ) }
{ children || __( 'Add campaign', 'google-listings-and-ads' ) }
</AppButton>
);
};
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/paid-ads/ads-campaign/ads-campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function AdsCampaign( {

let description = createInterpolateElement(
__(
'Paid Performance Max campaigns are automatically optimized for you by Google. <link>See what your ads will look like.</link>',
'Performance Max campaigns are automatically optimized for you by Google. <link>See what your ads will look like.</link>',
'google-listings-and-ads'
),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import AppDocumentationLink from '.~/components/app-documentation-link';
import CampaignPreview from '.~/components/paid-ads/campaign-preview';
import FreeAdCredit from '.~/components/free-ad-credit';
import VerticalGapLayout from '.~/components/vertical-gap-layout';
import useFreeAdCredit from '.~/hooks/useFreeAdCredit';
import './paid-ads-features-section.scss';

function FeatureList() {
Expand Down Expand Up @@ -49,8 +48,6 @@ function FeatureList() {
* for the next actions: skip or continue the paid ads setup.
*/
export default function PaidAdsFeaturesSection() {
const hasFreeAdCredit = useFreeAdCredit();

return (
<Section
className="gla-paid-ads-features-section"
Expand Down Expand Up @@ -111,8 +108,7 @@ export default function PaidAdsFeaturesSection() {
<CampaignPreview />
</FlexItem>
</Flex>

{ hasFreeAdCredit && <FreeAdCredit /> }
<FreeAdCredit />
</VerticalGapLayout>
</Section.Card.Body>
</Section.Card>
Expand Down
5 changes: 1 addition & 4 deletions js/src/components/paid-ads/asset-group/asset-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@
onClick={ handleLaunchClick }
>
{ isCreation
? __(
'Launch paid campaign',
'google-listings-and-ads'
)
? __( 'Create campaign', 'google-listings-and-ads' )

Check warning on line 166 in js/src/components/paid-ads/asset-group/asset-group.js

View check run for this annotation

Codecov / codecov/patch

js/src/components/paid-ads/asset-group/asset-group.js#L166

Added line #L166 was not covered by tests
: __( 'Save changes', 'google-listings-and-ads' ) }
</AppButton>
</StepContentActions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const EditProgramPromptModal = ( { programId, onRequestClose } ) => {
>
<p>
{ __(
'Results typically improve with time with Google’s Free Listing and paid ad campaigns.',
'Results typically improve with time.',
'google-listings-and-ads'
) }
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ const PauseProgramModal = ( props ) => {
>
<p>
{ __(
'Results typically improve with time with Google’s paid ad campaigns. If you pause, your products won’t be shown to people looking for what you offer.',
'Results typically improve with time. If you pause, your products won’t be shown to people looking for what you offer.',
'google-listings-and-ads'
) }
</p>
<p>
{ __(
'Pausing a paid ad campaign will result in the loss of any optimisations learned from those campaigns.',
'Pausing a campaign will result in the loss of any optimisations learned from those campaigns.',
'google-listings-and-ads'
) }
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const RemoveProgramModal = ( props ) => {
>
<p>
{ __(
'Results typically improve with time with Google’s paid ad campaigns. Removing a paid ad campaign will result in the loss of any optimisations learned from those campaigns.',
'Results typically improve with time. Removing a campaign will result in the loss of any optimisations learned from those campaigns.',
'google-listings-and-ads'
) }
</p>
Expand Down
2 changes: 1 addition & 1 deletion js/src/dashboard/campaign-creation-success-guide/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function CampaignCreationSuccessGuide( {
</div>
<GuidePageContent
title={ __(
`You've set up a paid Performance Max Campaign!`,
`You've set up a Performance Max Campaign!`,
'google-listings-and-ads'
) }
>
Expand Down
1 change: 1 addition & 0 deletions js/src/dashboard/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
margin-bottom: var(--main-gap);

@include break-medium {
align-items: flex-start;
flex-direction: row;
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/dashboard/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jest.mock( '@woocommerce/navigation', () => {
jest.mock( '.~/utils/isWCTracksEnabled', () => jest.fn() );

const CAMPAIGN_CREATION_SUCCESS_GUIDE_TEXT =
"You've set up a paid Performance Max Campaign!";
"You've set up a Performance Max Campaign!";
const CES_PROMPT_TEXT = 'How easy was it to create a Google Ad campaign?';

jest.mock( '.~/components/customer-effort-score-prompt', () => () => (
Expand Down
28 changes: 15 additions & 13 deletions js/src/dashboard/summary-section/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/**
* Internal dependencies
*/
import { glaData, REPORT_SOURCE_PAID, REPORT_SOURCE_FREE } from '.~/constants';
import { REPORT_SOURCE_PAID, REPORT_SOURCE_FREE } from '.~/constants';
import useAdsCampaigns from '.~/hooks/useAdsCampaigns';
import useAdsCurrency from '.~/hooks/useAdsCurrency';
import useCurrencyFormat from '.~/hooks/useCurrencyFormat';
import usePerformance from './usePerformance';
Expand Down Expand Up @@ -106,29 +107,30 @@
};

export default function SummarySection() {
const { adsSetupComplete } = glaData;
const { loaded, data: adsCampaignsData } = useAdsCampaigns();
if ( ! loaded ) {
return null;

Check warning on line 112 in js/src/dashboard/summary-section/index.js

View check run for this annotation

Codecov / codecov/patch

js/src/dashboard/summary-section/index.js#L112

Added line #L112 was not covered by tests
}
const showCampaignPromotionCard = ! adsCampaignsData?.length;

return (
<>
<SummaryCard
title={ __(
'Performance (Free Listing)',
'google-listings-and-ads'
) }
title={ __( 'Google Ads', 'google-listings-and-ads' ) }
>
<FreePerformanceCard />
{ showCampaignPromotionCard ? (
<PaidCampaignPromotionCard />

Check warning on line 122 in js/src/dashboard/summary-section/index.js

View check run for this annotation

Codecov / codecov/patch

js/src/dashboard/summary-section/index.js#L122

Added line #L122 was not covered by tests
) : (
<PaidPerformanceCard />
) }
</SummaryCard>
<SummaryCard
title={ __(
'Performance (Paid Campaigns)',
'Free Listings (Limited Visibility)',
'google-listings-and-ads'
) }
>
{ adsSetupComplete ? (
<PaidPerformanceCard />
) : (
<PaidCampaignPromotionCard />
) }
<FreePerformanceCard />
</SummaryCard>
</>
);
Expand Down
35 changes: 2 additions & 33 deletions js/src/dashboard/summary-section/paid-campaign-promotion-card.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,20 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Spinner } from '@woocommerce/components';

/**
* Internal dependencies
*/
import useGoogleAdsAccount from '.~/hooks/useGoogleAdsAccount';
import AddPaidCampaignButton from '.~/components/paid-ads/add-paid-campaign-button';
import { GOOGLE_ADS_ACCOUNT_STATUS } from '.~/constants';

const PromotionContent = ( { adsAccount } ) => {
const showFreeCredit =
adsAccount.sub_account ||
adsAccount.status === GOOGLE_ADS_ACCOUNT_STATUS.DISCONNECTED;

return (
<>
<p>
{ showFreeCredit
? __(
'Create your first campaign and get $500 in ad credit*',
'google-listings-and-ads'
)
: __(
'Create your first campaign',
'google-listings-and-ads'
) }
</p>
<AddPaidCampaignButton
eventProps={ { context: 'add-paid-campaign-promotion' } }
/>
</>
);
};
import PaidFeatures from './paid-features';

function PaidCampaignPromotionCard() {
const { googleAdsAccount } = useGoogleAdsAccount();

return (
<div className="gla-summary-card__body">
{ googleAdsAccount ? (
<PromotionContent adsAccount={ googleAdsAccount } />
) : (
<Spinner />
) }
{ googleAdsAccount ? <PaidFeatures /> : <Spinner /> }

Check warning on line 17 in js/src/dashboard/summary-section/paid-campaign-promotion-card.js

View check run for this annotation

Codecov / codecov/patch

js/src/dashboard/summary-section/paid-campaign-promotion-card.js#L17

Added line #L17 was not covered by tests
</div>
);
}
Expand Down
44 changes: 44 additions & 0 deletions js/src/dashboard/summary-section/paid-features/free-ad-credit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import GridiconGift from 'gridicons/dist/gift';
import { createInterpolateElement } from '@wordpress/element';

/**
* Internal dependencies
*/
import AppDocumentationLink from '.~/components/app-documentation-link';

/**
* Render the Free Ads Credit inside the Paid Features component.
*
* @fires gla_documentation_link_click with `{ context: 'dashboard', link_id: 'free-ad-credit-terms', href: 'https://www.google.com/ads/coupons/terms/' }`
* @return {JSX.Element} Free Ads Credit component.
*/
const FreeAdCredit = () => {
return (

Check warning on line 20 in js/src/dashboard/summary-section/paid-features/free-ad-credit.js

View check run for this annotation

Codecov / codecov/patch

js/src/dashboard/summary-section/paid-features/free-ad-credit.js#L20

Added line #L20 was not covered by tests
<div className="gla-free-ad-credit-claim">
<GridiconGift />
<div>
{ createInterpolateElement(
__(
'Claim $500 in ads credit when you spend your first $500 with Google Ads. <termLink>Terms and conditions apply</termLink>.',
'google-listings-and-ads'
),
{
termLink: (
<AppDocumentationLink
context="dashboard"
linkId="free-ad-credit-terms"
href="https://www.google.com/ads/coupons/terms/"
/>
),
}
) }
</div>
</div>
);
};

export default FreeAdCredit;
Loading
Loading