Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
31785d8
Added start date to campaigns.
jamesmorrison Feb 9, 2026
1a2af66
Load meta-boxes JS only on WC Edit Order screen
jamesmorrison Feb 10, 2026
65616b1
Fixed test issue with filemtime.
jamesmorrison Feb 10, 2026
6b5406a
Add new property within glaData to indicate whether source is Google.
jamesmorrison Feb 11, 2026
8398569
Removed QA instructions.
jamesmorrison Feb 11, 2026
6a0724a
Removed failing test.
jamesmorrison Feb 12, 2026
cded80b
Remove get_build_file_version(); was only used for test.
jamesmorrison Feb 12, 2026
dc5e54d
PR feedback.
jamesmorrison Feb 12, 2026
6053cdb
Update src/Admin/Admin.php
jamesmorrison Feb 12, 2026
ae19bb2
PR feedback and removed test file (because tests fail without build p…
jamesmorrison Feb 12, 2026
42ac347
Merge branch 'feature/GOOWOO-454-add-new-property-in-glaData-to-indic…
jamesmorrison Feb 12, 2026
dd577f0
Add mount point for attribution order meta box
AlejandroPerezMartin Feb 16, 2026
aea2022
Mock attribution source data in component
AlejandroPerezMartin Feb 16, 2026
42daff6
Expose campaign creation and recent paid campaign state to Channel Vi…
ankitrox Feb 16, 2026
5645285
Ensure JS loads for High-performance order storage" and "WordPress po…
jamesmorrison Feb 16, 2026
4df0bf8
Resolved conflicts.
jamesmorrison Feb 16, 2026
9e7928b
Fix: lint errors.
ankitrox Feb 16, 2026
e634e0b
Formatting
AlejandroPerezMartin Feb 17, 2026
eefe022
Merge branch 'feature/GOOWOO-453-load-meta-boxes-js-on-the-wc-edit-or…
AlejandroPerezMartin Feb 17, 2026
5474fe1
Fix webpack config
AlejandroPerezMartin Feb 17, 2026
059baf0
Update bundle sizes
AlejandroPerezMartin Feb 17, 2026
0ce29f8
Use 'OrderUtil::is_order_edit_screen' to determine whether meta box s…
jamesmorrison Feb 17, 2026
306807b
Resolved conflict.
jamesmorrison Feb 17, 2026
4324ebc
Added note to explain why we need to check `id` and `post` values for…
jamesmorrison Feb 17, 2026
46de205
Merge pull request #3252 from woocommerce/feature/GOOWOO-453-load-met…
asvinb Feb 17, 2026
b1b5e91
Merge pull request #3254 from woocommerce/feature/GOOWOO-454-add-new-…
asvinb Feb 17, 2026
a1577b7
Merge pull request #3256 from woocommerce/feature/GOOWOO-457-attribut…
asvinb Feb 17, 2026
3629711
Add start date to ads campaign
AlejandroPerezMartin Feb 17, 2026
b938c68
Add google ads promo component
AlejandroPerezMartin Feb 17, 2026
fbdff10
Add unit tests for ads promo component
AlejandroPerezMartin Feb 17, 2026
40ee055
Merge branch 'feature/in-product-placements' into feature/GOOWOO-458-…
asvinb Feb 17, 2026
6ab43b0
Merge pull request #3250 from woocommerce/feature/goowoo-455-update-a…
jjgrainger Feb 17, 2026
fcb1e75
refactor(google-ads-promo): Make promo content dynamic
asvinb Feb 17, 2026
594a5d2
Merge branch 'feature/in-product-placements' into feature/GOOWOO-458-…
asvinb Feb 17, 2026
bbbf8ec
refactor(AdsCampaign): correctly set optional start_date
asvinb Feb 17, 2026
e17ac5d
refactor(ads): Remove duplicate start date field and param
asvinb Feb 17, 2026
6e5d0fe
Merge branch 'feature/GOOWOO-458-googleads-promo-component' of github…
AlejandroPerezMartin Feb 17, 2026
0348f6d
Update tests and minor changes
AlejandroPerezMartin Feb 17, 2026
7c8d413
Fix phpcs error
AlejandroPerezMartin Feb 17, 2026
0ee1e1c
feat(admin): Expose order attribution to admin script
asvinb Feb 18, 2026
14bf1d4
style: Align inline script data keys
asvinb Feb 18, 2026
9c54f4f
Adjust title styles
AlejandroPerezMartin Feb 18, 2026
b6522a2
Add test for non active campaign
AlejandroPerezMartin Feb 18, 2026
2142c02
Merge branch 'feature/GOOWOO-458-googleads-promo-component' of github…
AlejandroPerezMartin Feb 18, 2026
ddfcc4e
Add tracking events to google ads promo component
AlejandroPerezMartin Feb 18, 2026
8090547
Track link href
AlejandroPerezMartin Feb 18, 2026
4b4b074
Resolve conflicts with base branch.
ankitrox Feb 18, 2026
1a05855
Update logic to only run event once, add tests for event tracking
AlejandroPerezMartin Feb 18, 2026
edc0f2a
Use correct url variable
AlejandroPerezMartin Feb 18, 2026
8b60bd7
Add glaData to products edit page.
ankitrox Feb 18, 2026
e4f536d
Use string for context
AlejandroPerezMartin Feb 19, 2026
d85390d
Hardcode dates for tests
AlejandroPerezMartin Feb 19, 2026
9d072b1
refactor(order-attribution): update script bundling and injection
asvinb Feb 19, 2026
92380e4
style: Reorder imports
asvinb Feb 19, 2026
5a3adb4
Merge pull request #3259 from woocommerce/feature/GOOWOO-458-googlead…
asvinb Feb 19, 2026
a14d923
Merge branch 'feature/in-product-placements' into feature/GOOWOO-460-…
asvinb Feb 19, 2026
27f9e57
Add metabox UI.
ankitrox Feb 19, 2026
5bde7d2
Restructure the component.
ankitrox Feb 19, 2026
10d1e21
Remove redundant code.
ankitrox Feb 19, 2026
2ae16e8
Merge branch 'feature/GOOWOO-460-googleads-promo-tracking' of github.…
AlejandroPerezMartin Feb 19, 2026
51459e1
Add jsdoc for events
AlejandroPerezMartin Feb 19, 2026
9da1977
Update select control.
ankitrox Feb 19, 2026
ae363af
Update bundle size.
ankitrox Feb 19, 2026
4605f8c
Add webpack config.
ankitrox Feb 19, 2026
ede7645
fix(google-ads): Corrects promo button URLs
asvinb Feb 20, 2026
61f75d5
docs(Tracking): Update Google Ads Promo tracking href examples
asvinb Feb 20, 2026
45ba1ae
Merge pull request #3260 from woocommerce/feature/GOOWOO-460-googlead…
asvinb Feb 20, 2026
d705180
Resolve conflicts with base branch.
ankitrox Feb 20, 2026
3a2489a
Fix: lint issues.
ankitrox Feb 20, 2026
d91db4b
Merge pull request #3257 from woocommerce/update/GOOWOO-456-expose-ca…
ankitrox Feb 20, 2026
73a5b0c
Format code
AlejandroPerezMartin Feb 24, 2026
374f239
Reorder imports
AlejandroPerezMartin Feb 24, 2026
816976e
Add tracking to channel visibility meta box
AlejandroPerezMartin Feb 24, 2026
a5a87ea
Minor tweaks
AlejandroPerezMartin Feb 25, 2026
84d803d
Merge pull request #3270 from woocommerce/feature/GOOWOO-461-add-trac…
AlejandroPerezMartin Feb 25, 2026
0b278ed
Merge branch 'update/GOOWOO-450-metabox-ui' of github.com:woocommerce…
AlejandroPerezMartin Feb 25, 2026
ace52d0
Merge branch 'feature/in-product-placements' of github.com:woocommerc…
AlejandroPerezMartin Feb 25, 2026
7b8ae8b
Layout and styling tweaks
AlejandroPerezMartin Feb 25, 2026
c0a5523
Remove hardcoded data and use channel visibility function
AlejandroPerezMartin Feb 25, 2026
157ac2d
Render issues
AlejandroPerezMartin Feb 25, 2026
852aa79
Show issues only when setup completed. Add message if product not vis…
AlejandroPerezMartin Feb 25, 2026
4a2f868
Disable select if product not visible
AlejandroPerezMartin Feb 25, 2026
171026f
Remove unused php logic
AlejandroPerezMartin Feb 25, 2026
fc1f865
Use issue as key in map
AlejandroPerezMartin Feb 27, 2026
3ddb5a9
Move constants to separate file, update jsdoc
AlejandroPerezMartin Feb 27, 2026
d3a16e3
Dynamically load available options for channel visibility
AlejandroPerezMartin Feb 27, 2026
ec7fbe2
Dynamically use field id
AlejandroPerezMartin Feb 27, 2026
1a81b54
Undo changes
AlejandroPerezMartin Feb 27, 2026
5c6f922
Rename constant, update events
AlejandroPerezMartin Mar 4, 2026
fa8df1c
Refactor component names
AlejandroPerezMartin Mar 4, 2026
70e72f2
Rename variables
AlejandroPerezMartin Mar 6, 2026
ec46dfd
refactor(channel-visibility): Replace FlexItem with FlexBlock component
asvinb Mar 6, 2026
7962cfb
refactor(product-channel-visibility): Use index as key for issues map
asvinb Mar 6, 2026
77952b3
Merge branch 'develop' into feature/in-product-placements
asvinb Mar 6, 2026
9c4108b
Merge branch 'feature/in-product-placements' of github.com:woocommerc…
asvinb Mar 6, 2026
07f4a6e
docs: Format tracking README tables and lists
asvinb Mar 6, 2026
a27876e
Merge branch 'feature/in-product-placements' into update/GOOWOO-450-m…
asvinb Mar 6, 2026
373b7c3
build: Update bundle size limits
asvinb Mar 6, 2026
96e0d1d
feat(admin): Add product channel visibility metabox
asvinb Mar 6, 2026
6ffb44b
Fix: failing php test.
ankitrox Mar 6, 2026
394e3ee
Merge pull request #3262 from woocommerce/update/GOOWOO-450-metabox-ui
ankitguptaindia Mar 9, 2026
84d41b5
Restore meta-boxes/index.js console log message.
jamesmorrison Mar 10, 2026
4d403ae
Reorder JS..
jamesmorrison Mar 10, 2026
1b89045
Merge pull request #3291 from woocommerce/fix/GOOWOO-453-load-meta-bo…
ankitguptaindia Mar 13, 2026
6bbcd93
Revert "[GOOWOO-453] Fix meta-boxes JS only on WC Edit Order screen"
ankitguptaindia Mar 13, 2026
7361479
Merge pull request #3295 from woocommerce/revert-3291-fix/GOOWOO-453-…
ankitguptaindia Mar 16, 2026
2d7855e
Merge branch 'develop' into feature/in-product-placements
asvinb Mar 18, 2026
8942759
Merge branch 'feature/in-product-placements' of github.com:woocommerc…
asvinb Mar 18, 2026
7357a14
fix: Corrects typo in Google logo SVG path
asvinb Mar 18, 2026
72390c4
chore: Update asset max size budgets
asvinb Mar 18, 2026
1ea106d
build: Update expected build artifact sizes
asvinb Mar 18, 2026
e16dd18
Update tracking event
AlejandroPerezMartin Mar 19, 2026
9689b2f
Merge pull request #3312 from woocommerce/fix/GOOWOO-526-campaign-tra…
asvinb Mar 19, 2026
3756906
Merge branch 'develop' into feature/in-product-placements
asvinb Mar 19, 2026
14c2338
Merge branch 'feature/in-product-placements' of github.com:woocommerc…
asvinb Mar 19, 2026
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
129 changes: 129 additions & 0 deletions js/src/meta-boxes/channel-visibility/channel-visibility-settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/**
* External dependencies
*/
import {
Flex,
FlexBlock,
FlexItem,
Notice,
SelectControl,
} from '@wordpress/components';
import { useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import { glaData } from '~/constants';
import googleLogoURL from '~/images/logo/google-g-logo.svg';

const {
channelVisibility: {
field_id: fieldId,
channel_visibility: channelVisibility,
product_is_visible: productIsVisible,
issues = [],
options = [],
} = {},
} = glaData || {};

/**
* Channel Visibility Settings component.
*
* The component will allow the user to select the channel visibility for the product and
* will be displayed when the ads setup is complete.
*
* @return {JSX.Element} The Channel Visibility Settings component
*/
const ChannelVisibilitySettings = () => {
const [ channelVisibilityValue, setChannelVisibilityValue ] = useState(
productIsVisible ? channelVisibility : 'dont-sync-and-show'
);
let productIssues = issues;

// Adds warning message if the product is not visible
if ( ! productIsVisible ) {
productIssues = [
...issues,
__(
'This product cannot be shown on any channel because it is hidden from your store catalog.',
'google-listings-and-ads'
),
];
}

/**
* Parse the options object into an array of options.
* Options is an object with the following structure:
* {
* 'sync-and-show': 'Sync and show',
* 'dont-sync-and-show': "Don't sync and show",
* }
*
* @return {Array<{label: string, value: string}>}
*/
const selectOptions = Object.entries( options ).map(
( [ value, label ] ) => ( { label, value } )
);

return (
<Flex direction="column" gap={ 4 } className="gla-channel-visibility">
<FlexBlock>
<Flex gap={ 2 } align="center" justify="flex-start">
<FlexItem>
<Flex gap={ 2 } align="center">
<FlexItem>
<img
className="gla-channel-visibility__logo"
src={ googleLogoURL }
alt={ __(
'Google Logo',
'google-listings-and-ads'
) }
width={ 16 }
height={ 16 }
/>
</FlexItem>
<FlexItem>
{ __( 'Google', 'google-listings-and-ads' ) }
</FlexItem>
</Flex>
</FlexItem>
{ selectOptions.length > 0 && (
<FlexBlock>
<SelectControl
name={ fieldId }
options={ selectOptions }
value={ channelVisibilityValue }
onChange={ ( value ) =>
setChannelVisibilityValue( value )
}
disabled={ ! productIsVisible }
__nextHasNoMarginBottom
/>
</FlexBlock>
) }
</Flex>
</FlexBlock>

{ productIssues.length > 0 && (
<FlexBlock>
<Notice status="warning" isDismissible={ false }>
<p>
<strong>
{ __( 'Issues', 'google-listings-and-ads' ) }
</strong>
</p>
<ul>
{ productIssues.map( ( issue ) => (
<li key={ issue }>{ issue }</li>
) ) }
</ul>
</Notice>
</FlexBlock>
) }
</Flex>
);
};

export default ChannelVisibilitySettings;
2 changes: 2 additions & 0 deletions js/src/meta-boxes/channel-visibility/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const CHANNEL_VISIBILITY_CONTEXT = 'channel-visibility-meta-box';
export const CHANNEL_VISIBILITY_PROMO_KEY = 'gla_google_ads_promo_dismissed';
46 changes: 46 additions & 0 deletions js/src/meta-boxes/channel-visibility/get-started-cta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import AppButton from '~/components/app-button';
import { getGetStartedUrl } from '~/utils/urls';
import { CHANNEL_VISIBILITY_CONTEXT } from './constants';

/**
* Google Ads Promo "Get started" button is clicked.
*
* @event gla_google_ads_promo_get_started_click
* @property {string} context Context of the Google Ads Promo.
* @property {string} href URL of the "Get started" button.
*/

/**
* Get Started CTA component.
*
* @fires gla_google_ads_promo_get_started_click with `{ context: channel-visibility-meta-box, href: 'admin.php?page=wc-admin&path=%2Fgoogle%2Fstart' }`.
*
* @return {JSX.Element} The Get Started CTA component.
*/
const GetStartedCTA = () => {
const getStartedUrl = getGetStartedUrl();

return (
<AppButton
href={ getStartedUrl }
eventName="gla_google_ads_promo_get_started_click"
eventProps={ {
href: getStartedUrl,
context: CHANNEL_VISIBILITY_CONTEXT,
} }
isSecondary
>
{ __( 'Get started', 'google-listings-and-ads' ) }
</AppButton>
);
};

export default GetStartedCTA;
123 changes: 123 additions & 0 deletions js/src/meta-boxes/channel-visibility/google-ads-promo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/**
* External dependencies
*/
import { Flex, FlexBlock, FlexItem } from '@wordpress/components';
import { useDispatch } from '@wordpress/data';
import { useEffect, useRef } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { store as preferencesStore } from '@wordpress/preferences';

/**
* Internal dependencies
*/
import { PREFERENCES_STORE_NAMESPACE, glaData } from '~/constants';
import usePreference from '~/hooks/usePreference';
import googleLogoURL from '~/images/logo/google-g-logo.svg';
import { recordGlaEvent } from '~/utils/tracks';
import {
CHANNEL_VISIBILITY_PROMO_KEY,
CHANNEL_VISIBILITY_CONTEXT,
} from './constants';
import GetStartedCTA from './get-started-cta';
import PromoCTA from './promo-cta';
import ChannelVisibilitySettings from './channel-visibility-settings';
import './google-ads-promo.scss';

const { adsSetupComplete } = glaData;

/**
* Google Ads Promo banner is shown.
*
* @event gla_google_ads_promo_shown
* @property {string} context Context of the Google Ads Promo.
*/

/**
* Google Ads Promo component.
*
* @fires gla_google_ads_promo_shown with `{ context: channel-visibility-meta-box }`.
*
* @return {JSX.Element} The Google Ads Promo component
*/
const GoogleAdsPromo = () => {
const { set } = useDispatch( preferencesStore );
const isDismissed = usePreference( CHANNEL_VISIBILITY_PROMO_KEY );
const hasTrackedRef = useRef( false );

useEffect( () => {
if ( ! hasTrackedRef.current ) {
recordGlaEvent( 'gla_google_ads_promo_shown', {
context: CHANNEL_VISIBILITY_CONTEXT,
} );
hasTrackedRef.current = true;
}
}, [] );

const handleDismiss = () => {
set( PREFERENCES_STORE_NAMESPACE, CHANNEL_VISIBILITY_PROMO_KEY, true );
};

if ( adsSetupComplete ) {
return <ChannelVisibilitySettings />;
}

return (
<Flex className="gla-channel-visibility" direction="column" gap={ 4 }>
<FlexBlock>
<Flex gap={ 2 } align="center" justify="flex-start">
<FlexItem>
<img
className="gla-channel-visibility__logo"
src={ googleLogoURL }
alt={ __(
'Google Logo',
'google-listings-and-ads'
) }
width={ 16 }
height={ 16 }
/>
</FlexItem>
<FlexItem>
{ __( 'Google', 'google-listings-and-ads' ) }
</FlexItem>
{ isDismissed && (
<FlexItem className="gla-channel-visibility__get-started--is-dismissed">
<GetStartedCTA />
</FlexItem>
) }
</Flex>
</FlexBlock>

{ ! isDismissed && (
<Flex
className="gla-channel-visibility__content"
direction="column"
gap={ 3 }
>
<FlexBlock>
<h3 className="gla-channel-visibility__title">
{ __(
'Get your products on Google',
'google-listings-and-ads'
) }
</h3>
</FlexBlock>
<FlexBlock>
<p>
{ __(
'Sync your products to reach customers when they’re searching for products like yours across Google',
'google-listings-and-ads'
) }
</p>
</FlexBlock>

<FlexBlock>
<PromoCTA onDismiss={ handleDismiss } />
</FlexBlock>
</Flex>
) }
</Flex>
);
};

export default GoogleAdsPromo;
31 changes: 31 additions & 0 deletions js/src/meta-boxes/channel-visibility/google-ads-promo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.gla-channel-visibility {
padding: $grid-unit-05;
}

.gla-channel-visibility__logo {
display: block;
}

.gla-channel-visibility__title {
font-size: $gla-font-base;
font-weight: 600;
line-height: $gla-line-height-medium;
letter-spacing: 0;
margin: 0;
}


.gla-channel-visibility__content {
background-color: rgb(56 88 233 / 0.03);
border: 1px solid rgb(56 88 233 / 0.16);
border-radius: $grid-unit-05;
padding: $grid-unit-20;

p:last-child {
margin: 0;
}
}

.gla-channel-visibility__get-started--is-dismissed {
margin-left: auto;
}
42 changes: 42 additions & 0 deletions js/src/meta-boxes/channel-visibility/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* External dependencies
*/
import { createRoot, lazy, Suspense } from '@wordpress/element';

/**
* Internal dependencies
*/
import { glaData } from '~/constants';

const GoogleAdsPromo = lazy( () =>
import(
/* webpackChunkName: "channel-visibility-google-ads-promo" */ './google-ads-promo'
)
);

document.addEventListener( 'DOMContentLoaded', () => {
// Only render the component if the channel visibility is set
if ( glaData?.channelVisibility?.length === 0 ) {
return;
}

const channelVisibilityBox = document.querySelector(
'#gla-channel-visibility-box'
);

if ( ! channelVisibilityBox ) {
return;
}

// Create empty div to serve as mount point for React components
const glaElement = document.createElement( 'div' );
const root = createRoot( glaElement );

root.render(
<Suspense>
<GoogleAdsPromo />
</Suspense>
);

channelVisibilityBox.prepend( glaElement );
} );
Loading
Loading