Skip to content

Commit

Permalink
Remove support for gtin optimizer.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 369155418
  • Loading branch information
starmandeluxe committed Apr 21, 2021
1 parent 026862e commit e9e4156
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 311 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ color-length-optimizer | _Optimization_ | Fixes the length o
condition-optimizer | _Sanitization_ | If the condition field is specified as "new", but other fields in the product imply that the condition is otherwise, this optimizer will set the condition value to "used". This will lead to the product avoiding disapproval. (It is also possible that accounts that misrepresent condition can be suspended.)
description-optimizer | _Optimization_ | Appends the following product attributes to the product description if they could be mined: brand, color, sizes, gender. It will also create the description from these attributes if it does not exist. These mined fields being in the description have a possibility to increase ad performance. (This optimizer will also perform attribute mining: brand, color, sizes, and gender attributes will be added to the product fields if they do not exist and could be mined.)
free-shipping-optimizer | _Sanitization_ | Removes promotional text related with free shipping from title. This will lead to the product avoiding disapproval. It must be run before title-optimizer.
gtin-optimizer | _Sanitization_ | For 14-digit GTIN values, the gtin must not make use of the bulk indicator digit (9) as specified [here](https://www.gs1.org/1/gtinrules/en/rule/167/bulk-items). It must also not make use of the restricted ranges in the company prefix as specified [here](https://support.google.com/merchants/answer/6286302), nor make use of coupon ranges as specified [here](https://support.google.com/merchants/answer/6324461?hl=en). Finally, the last digit of the gtin must match the formula defined by the GS1 standard as described [here](https://www.gs1.org/services/how-calculate-check-digit-manually). If the gtin fails any of these checks, this optimizer will delete the gtin field from the product. This will lead to the product avoiding disapproval.
identifier-exists-optimizer | _Sanitization_ | Removes invalid identifierExists fields. Items that have a brand, mpn, or gtin set and identifierExists as "false" cause disapproval, so this optimizer will delete the identifierExists value in these cases, which defaults the value to true via Content API. This will lead to the product avoiding disapproval.
invalid-chars-optimizer | _Sanitization/Optimization_ | Removes invalid chars from the product title and description. Invalid chars are those with code points that map to the Unicode private use area (0xE000-0xF8FF). This will lead to the product avoiding disapproval if the invalid char is in the title, and lead to the description not being rejected if the invalid char is in the description.
mpn-optimizer | _Sanitization_ | Removes invalid MPN fields. Certain MPN values will cause products to be disapproved. If an invalid MPN value is detected, this optimizer will delete it. This will lead to the product avoiding disapproval. The list of invalid MPNs can be found in `mpn_optimizer.py`.
Expand Down
5 changes: 2 additions & 3 deletions docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ _**Optional:**_
* `condition-optimizer=(true/false)`
* `description-optimizer=(true/false)`
* `free-shipping-optimizer=(true/false)`
* `gtin-optimizer=(true/false)`
* `identifier-exists-optimizer=(true/false)`
* `invalid-chars-optimizer=(true/false)`
* `mpn-optimizer=(true/false)`
Expand Down Expand Up @@ -486,10 +485,10 @@ def shoptimize(original_product_batch_dictionary: Dict[str, Any]) -> Dict[str, A
Append `optimizer-key=true` as a URL parameter in your call to Shoptimizer for
each optimizer you want to run.

For example, to run the mpn-optimizer and gtin-optimizer, use the following
For example, to run the mpn-optimizer and title-optimizer, use the following
endpoint:

`.../shoptimizer/v1/batch/optimize?mpn-optimizer=true&gtin-optimizer=true`
`.../shoptimizer/v1/batch/optimize?mpn-optimizer=true&title-optimizer=true`

## 6. Writing a Plugin

Expand Down
203 changes: 0 additions & 203 deletions shoptimizer_api/optimizers_builtin/gtin_optimizer.py

This file was deleted.

104 changes: 0 additions & 104 deletions shoptimizer_api/optimizers_builtin/gtin_optimizer_test.py

This file was deleted.

0 comments on commit e9e4156

Please sign in to comment.