Skip to content

Streamlined Free Listings plus Paid Ads for the onboarding flow #1610

Closed
@eason9487

Description

@eason9487

Objective

  • An onboarding flow for the integration offers merchants a choice of selecting Free Listings plus Paid Ads.
  • The ability for merchants to:
    • preview the ads or campaigns they are about to launch,
    • know how many products will be synced to Google Merchant Center,
    • and set up billing for their Google Ads account via a popup.

💡 We will create a shared branch feature/1610-streamlined-onboarding. All relevant developments should be branched from it and merged back into it. And open a PR to merge the shared branch to develop once the overall features get ready to release.

Terminology

  • FL: Free Listings

Technical - Frontend

The UI changes are mainly applied to the onboarding flow, and some shared components used in the Edit free listings page and Set up paid campaign page might be changed respectively.

Most requirements are listed in pcTzPl-Kc-p2#the-flow-breakdown and the related Figma document. This list only outlines other changes besides the p2 post.

📌 Adjust the setting sections in the onboarding steps

📌 Update other UI changes

Refer to Landing Page, Step 1: Set up accounts, Step 2: Configure product listings, Step 3: Confirm store requirements, and Submission Success in pcTzPl-Kc-p2#the-flow-breakdown

📌 Product feed status section

Refer to Step 4.1: Setting up Paid Ads in pcTzPl-Kc-p2#the-flow-breakdown

📌 Boost product listings section

Refer to Card 2 in Step 4: Complete your campaign with paid ads in pcTzPl-Kc-p2#the-flow-breakdown

Site logo: https://wordpress.com/support/site-logo/

📌 Google Ads account section

Refer to Step 4.1: Setting up Paid Ads in pcTzPl-Kc-p2#the-flow-breakdown

📌 Ads audience and budget sections

Refer to Step 4.1: Setting up Paid Ads in pcTzPl-Kc-p2#the-flow-breakdown

📌 Billing Ads card

Refer to Step 4.2: Set up Billing Ads in pcTzPl-Kc-p2#the-flow-breakdown

📌 Post-onboarding setup flow

📌 Client states management and API integration

📌 Event tracking

2022-09-21 15 35 55
2022-09-21 15 36 36

  • gla_onboarding_complete_button_click for A and C with these properties:
    • opened_paid_ads_setup: yes | no
    • google_ads_account_status: unknown | connected | disconnected | incomplete
    • billing_method_status: unknown | pending | approved | cancelled
    • campaign_form_validation: unknown | valid | invalid
    • The unknown status is used when the paid ads setup is not opened.
  • gla_onboarding_open_paid_ads_setup_button_click for B
  • gla_onboarding_complete_with_paid_ads_button_click for D

# Technical - Backend

# 📌 A new API for onboarding completed

In the previous onboarding flow the last API frontend calls is mc/settings/sync. It will set the timestamp to the option gla_mc_setup_completed_at. In the new onboarding flow, this API will be called again in step 4 to ensure all settings are updated if a merchant changes anything after they enter step 4 and then back to steps 13.~

We decide to create a new API mc/setup/complete and move the logic of setting the timestamp to the option gla_mc_setup_completed_at to this new API. (MC_SETUP_COMPLETED_AT in PHP code)

  • Create a new API POST mc/setup/complete to set the timestamp to the option gla_mc_setup_completed_at.
    • Payload: No payload
    • Response:
      • Status: 201 Created
      • Data: No data
  • In the API mc/settings/sync, do not set the timestamp to the option gla_mc_setup_completed_at.

# 📌 Extends mc/product-statistics API to return # of syncable products

In the step 4 of the new onboarding flow, we will display Your product listings are ready to be uploaded • # products on the first card. The # in the wording is the number of products that are ready to be synced. After some discussion on the project post (pcTzPl-I1-p2#comment-1604) we decide the extend an existing API mc/product-statistics and return a new data syncable_products in the response data. We can reuse an existing method find_sync_ready_products in src/Product/ProductRepository.phpWe will create two new APIs, GET mc/syncable-products-count and POST mc/syncable-products-count for this requirement.

  • In API mc/product-statistics, modify the logic to return the following new data:
    {
        "timestamp": null,
        "statistics": null,
        "scheduled_sync": 0,
        "syncable_products": 29
    }
  • Revisit the logic of display product overview in the GLA product feed page. The sum of the products there should be the number of syncable products, rather the number of total products in WooCommerce.

# 📌 Syncable Products Count

In the step 4 of the new onboarding flow, we will display Your product listings are ready to be uploaded • # products on the first card. The # in the wording is the number of products that are ready to be synced. We will create two new APIs, GET mc/syncable-products-count and POST mc/syncable-products-count for this requirement.

# 📌 Verify all the logics depend on gla_ads_setup_completed_at

Frontend will call the API ads/setup/complete if merchants set up Paid Ads in step 4, and this API will set the timestamp to the option gla_ads_setup_completed_at. (ADS_SETUP_COMPLETED_AT in PHP code)

  • Verify all the logics depend on gla_ads_setup_completed_at, update code if needed.

# 📌 Update the step name logic returned by the API mc/setup

Since some of the steps in the new onboarding flow are changed in order or merged together.

# 📌 Return merchants key product data (e.g. bestselling)

If we aim at returning the bestselling product, we don’t need to add a new API for it. Instead, we can extend the existing API mc/product-feed and doing some extra meta query to get the product that has largest total sales. However, we would need to add extra returned data such as product image and price for the API mc/product-feed. More information can be found in pcTzPl-I1-p2#comment-1533.

Example:

// GET mc/product-feed?per_page=1&orderby=total_sales&order=desc

{
    "products": [
        {
            "id": 279,
            "title": "Product title",
            "visible": true,
            "status": "disapproved",
            "errors": [],
            "price": "10", // new data
            "image_url": "https://example.com/example.png", // new data
        }
    ],
    "total": 28,
    "page": "1"
}

Frontend needs to display the site logo, instead of putting it in product-feed AP, it's more appropriate to add it in glaData.siteLogoUrl.

Example on how to get the custom site logo url:

wp_get_attachment_image_url( get_theme_mod( 'custom_logo' ), 'full' );

Note that if the site admin does not upload a custom site logo, the above code will return false.
In glaData.siteLogoUrl it will be null.

Links

Project:

  • Project thread: pcTzPl-I1-p2
  • Design thread: pcTzPl-Kc-p2

Figma:

  • fqR0EHi63lWahRcVTKCcba-fi-4%3A36753

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions