Wp-calypso: (3P) Update API route to accept vertical slug

Created on 17 Jun 2019  路  10Comments  路  Source: Automattic/wp-calypso

We read the vertical from site_options. This should be assigned during onboarding and should be the vertical _ID_.

eg: https://public-api.wordpress.com/wpcom/v2/verticals/p31v28/templates

However for some sites we are getting the Vertical _Name_.

eg: https://public-api.wordpress.com/wpcom/v2/verticals/Cameras%20&%20Photography/templates

We need to know either that

  1. It's ok to exclude those sites using _Name_ from the feature
  2. Update the API to accept both types (ie: ID or Name)
[Goal] Full Site Editing [Type] Bug

All 10 comments

Note that synonyms are also available and used for searching. Could we add the pretty slug to the synonyms for matching.

@michaeldcain It looks like some Jetpack sites save the vertical slug instead of the vertical id in their site_vertical option. We use that value to retrieve templates from the API.
Are you aware of that behavior, is that expected? Should it be changed? Or should we just update the API endpoint to accept either?

Note that synonyms are also available and used for searching.

@getdave I believe the synonyms won't be searched until the ES integration is complete.

It looks like some Jetpack sites save the vertical slug instead of the vertical id in their site_vertical option.

@obenland: I believe that this is done when the user's input doesn't match to one of our verticals, and was done as part of some JP data analysis (panfyZ-18-p2). I don't think you should update your endpoint to accept either. @jeffgolenski @mikael what do y'all think of removing that exception?

Have chased in CJS75TX3R/p1562148628090300-slack-ajax

I'll let @simison speak to the technicalities of this. It doesn't matter to me how it's done. Just that we collect that data. Let me know if I'm missing anything!

@obenland, @simison

For Jetpack (and non-atomic) sites we indeed enabled free text for both Site Type and Vertical in D26585-code, meaning we save plain text if no id is encoded. It is an option, not a rule, both are possible atm. It was the discovery phase for Jetpack options, thus we did not impose set categories.

That said, data analysis of the vertical step ( see panfyZ-1w-p2 ) indicated that in fact, it can be removed. Or re-run, refined and removed, since its usage at the time of the analysis was < 3%.

To summarise next steps for @Automattic/ajax :

  1. Storage of vertical data during onboarding has been disabled.
  2. If it is ever re-enabled at any point you鈥檝e advised changing name to slug to match up with .com
  3. We still need to update our Plugin鈥檚 code to account for JP sites that have already been created with name as the vertical

See also paObgF-k1-p2.

Important

This is being addressed in D30218-code

Steps collecting this data during jetpack flow being removed in https://github.com/Automattic/wp-calypso/pull/34506

Shipped D30218-code

Was this page helpful?
0 / 5 - 0 ratings