Case study 6: Adding product attributes with import
You can import new products with attributes like UPC or Brand, or you can import attributes for products that already exist in your store. If a product already exists in your store, you can add attributes to it without having data on the product they belong to in the file.
In this section, you’ll learn how to import new attributes to products that already exist in your store.
You can create the attributes you need beforehand in Settings → Product types or you can simply import the file that contains columns dedicated to these attributes along with the attribute values. In this case, new attributes will be created in your store automatically.
In our example, we’ll add four new product attributes to two existing store products (their SKUs are A0001 and A0002):
UPC attribute (12345678901 and 12345678902) and Brand attribute (“Surf Paradise”) will be added to both products, and custom “Color” attribute (Blue) along with a custom “Country of origin" (Canada) attribute will be added only to the second product.
To create an import file:
- Open your spreadsheet editor.
- Enter “type” in the first cell. Then enter “product” in the row below it:
Now you’ve specified that the second row is about a product. - In the next column, enter “product_sku” and the SKU of the first product (“A0001”):
Now the attribute data listed in this row will be added to a product with this specific SKU.Optionally, you can add the “product_internal_id” column and the ID of the product, or you can use both the ID and SKU columns to specify the product your attributes must be assigned to. - Then add the “product_upc” column to the file header and enter “12345678901” as its value for the “product” row:
This way, you specify UPC for the first product. - Next, similarly, enter the “product_brand” column and the “Surf Paradise” value for it.
- Congrats! You have entered all the data you need for the first product (the one with “A0001” SKU).
Now add a new “product” row. It will be dedicated to the second product:
- Enter “A0002” for the “product_sku” column in the new “product” row, then enter “12345678902” for “product_upc” and “Surf Paradise” for “product_brand”.
- Next, you’ll need to create columns for your custom product attributes by replacing the {Attribute name} part in the generic “product_attribute_{Attribute name}” column name.
So you need to add the “product_attribute_Color” column to the file header and “Blue” as the row value. This way, you will specify that you want your second product to have the custom “Color” attribute with the “Blue” value:
- Similarly, enter “product_attribute_{Country of origin}” and “Canada”.
Curly brackets {} help import attribute names that consist of several words.
- Now save/download the file as .csv to your device. In Google Sheets, you can do it by going to File → Download → Comma Separated Values (.csv).
That’s it! You’ve compiled a CSV file for four different attributes that must be added to the two products that already exist in your store (you can find the “product_attributes” file in the article attachments):
After you upload this file on the Catalog → Data Import & Export page, these attributes will be added to your products. Here’s how they will look for the second product on the Attributes tab in your store admin:
Now you can choose any attributes you need for your catalog and follow these instructions step by step to compile your own CSV file.
See the list of available product attribute columns →
If later you need to update attributes that exist in your store, you can simply edit the file and add new values for them or create a new file from scratch.