site-kit-wp
site-kit-wp copied to clipboard
Implement partner service for new campaign creation completed signal
Feature Description
When the campaign creation portion of the PAX setup flow is completed, the partner campaignService
can be used to respond to the event.
The handler is defined as part of the service and provided to the app at launch time.
This handler should be contained within the SetupMainPAX
component given that it is only ever relative to PAX onboarding/setup flow. See #8558
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The
SetupMainPAX
component should be updated to provide an implementation of the app'snotifyNewCampaignCreated
handler of thecampaignService
- This requires an update to the
PAX
component as well such that it should receive a new optionalonCampaignCreated
function prop- When provided, this function should be included as the value to the
services.campaignService.notifyNewCampaignCreated
definition (example)
- When provided, this function should be included as the value to the
- The
onCampaignCreated
function passed should (when called) set the conversion ID and customer IDs currently being set by the main submit button - The main submit button should then only be enabled when these IDs have valid values in state, and the campaign creation has been completed
- Invoking it should then submit changes / save and navigate as usual
- The embedded app can also be hidden once the conditions are met to enable the main submit button as above although this may not be necessary depending on the behavior of the
displayMode
- This requires an update to the
Implementation Brief
- [x] Within the
<SetupMainPAX>
component file:- Define a function which uses the
app
instance (from the existing value provided toonLaunch
defined in #8557) and its available services (viaapp.getServices()
) as should already be done in the component, but attached to the main submit button- Extract the existing behavior (setting conversion + customer IDs) except for the submit changes action from the main submit button to this new function as defined in the AC
- Hide the main PAX component if necessary
- Pass this function to the (new)
onCampaignCreated
prop of thePAXEmbeddedApp
- Define a function which uses the
- [x] Update the
PAXEmbeddedApp
to accept an optionalonCampaignCreated
prop- If provided a function, merge it into the definition of
services
provided to the app asservices.campaignService.notifyNewCampaignCreated: onCampaignCreated
- If provided a function, merge it into the definition of
Test Coverage
- Add or update existing tests for the
PAXEmbeddedApp
component to test that the callback function is included in the service definitions as expected
QA Brief
- Set up Site Kit with
adsPax
feature flags - Go to Ads module setup screen and click on
create account
button- If you do not have
adwords
scope granted, you should see notice bellow the button, upon clicking the button, you will be redirected to the OAuth flow - If you have the scope already, it should skip OAuth step and launch PAX app
- If you do not have
- Upon completing all steps in PAX, a
complete setup
button should replace it - Once clicked, it should connect Ads module and redirect you to the dashboard with success subtle banner showing
- Settings view of Ads module should show
Conversion Tracking ID
andCustomer ID
values, but not when editing the settings
Changelog entry
- Implement partner service for new campaign creation completed signal.