woocommerce / google-listings-and-ads

Sync your store with Google to list products for free, run paid ads, and track performance straight from your store dashboard.
https://woo.com/products/google-listings-and-ads/
GNU General Public License v3.0
44 stars 21 forks source link

Add extra query parameter when returning to dashboard after successful campaign creation. #2439

Closed hafizrahman closed 2 months ago

hafizrahman commented 2 months ago

User story

The WooCommerce mobile apps is about to enable paid campaigns creation thru the app. The initial plan is to open a webview to wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard&subpath=%2Fcampaigns%2Fcreate, to start merchants on the wp-admin campaign creation flow.

Furthermore, the app needs to be able to track when a campaign is successfully created on mobile. This is to be done by listening to the currently opened page in the webview and checking if it's the redirect page after successful creation.

At the moment, a successful campaign creation redirects to the GLA plugin dashboard page, on page=wc-admin&path=%2Fgoogle%2Fdashboard. This URL unfortunately is not unique enough to be used for checking success state, since merchants can also navigate normally in the webview to this page, without completing a campaign creation.

A suggested solution will be to add an extra query parameter to the redirect URL after successful campaign, e.g: page=wc-admin&path=%2Fgoogle%2Fdashboard&campaign=saved

This will be a unique enough URL that can be used by the mobile apps to check for success state.

Additional details:

pcTzPl-2mX-p2