Expose GLA conversion ID in the Ads datastore #10274
Labels
javascript
Pull requests that update Javascript code
Module: Ads
Google Ads module related issues
P0
High priority
PHP
Team S
Issues for Squad 1
Type: Feature
New feature
Feature Description
As a dependency to #10257, there is a need to create a new REST controller to retrieve the value from the
ads_conversion_action
option, for use in the Ads module datastore. This is required in order to determine whether the warning notice should be surfaced for users manually entering the same Ads ID in Site Kit as was linked/configured/created in Google for WooCommerce.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
A new REST controller is created in Ads that retrieves the value of theads_conversion_action
option.Updates to the Ads module datastore are made and a selector added to retrieve said value above, if it exists.gla_ads_conversion_action
optionImplementation Brief
Note: Since there was no need to protect the ID - it is already a public data, and fetching it was not time sensitive, approach was changed to store it in inline data
Google\Site_Kit\Modules\Ads::get_datapoint_definitions
methodGET:gla-connected-ads-id
service
Google\Site_Kit\Modules\Ads::create_data_request
GET:gla-connected-ads-id
route callback, it should:gla_ads_conversion_action
option value. It will be an array if option existsconversion_id
key of the retrieved array, and if set return it as responseassets/js/modules/ads/datastore/google-listings-and-ads.js
initialState
, sayglaConnectedAdsId
, withundefined
as initial valuefetchGetGLAConnectedAdsIdStore
modules
,ads
,gla-connected-ads-id
)getGLAConnectedAdsId
resolver to retrieve the data by invoking the fetch storegetGLAConnectedAdsId
selector to return value from the stateMODULES_ADS
datastoreTest Coverage
QA Brief
adsPax
feature flag enabledawait googlesitekit.data.select('modules/ads').getGoogleForWooCommerceConversionID()
''
Google for WooCommerce
plugin, after you complete the setup and connect it with Ads campaign go to dashboard and output the same snippet, it shoukld output the connected conversion ID, in will be in format ofAW-xxxx
Changelog entry
The text was updated successfully, but these errors were encountered: