Importing Customer Metafields

Topic summary

Users are troubleshooting issues with importing customer metafields via CSV files in Shopify, despite official documentation indicating this should be possible.

Initial Problem:

  • The original poster created a CSV using Shopify’s template with metafield columns as documented, but the import preview phase rejected the fields as invalid, even though the metafields existed in the admin.
  • Support ticket provided conflicting information compared to documentation.

Solution Found:

  • Exporting existing customers with metafields revealed the correct column naming syntax.
  • Column headers must use full syntax: customer.metafields.custom.[field_name] rather than just custom.[field_name].

Key Technical Requirements:

  • Metafields must already exist in Shopify admin before importing.
  • Only 6 of 26 metafield data types are supported for CSV import/export: Boolean, Date, Date and Time, Integer, Decimal, and Single line text.
  • Country codes must use the two-digit ISO format (e.g., “AU” not “AUS”).
  • Column order should match the sequence in Shopify’s metafield settings and sample export files.

Status: Issue resolved through trial and error. One user suggested Shopify should implement better field mapping UI during import, similar to legacy database systems.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

According to the Shopify Help documentation, not only can you create customer metafields but you can also use those fields as import fields when importing customers. I cannot make this work. I opened a ticket and was told that it would not work which is contrary to the documentation. That ticket remains open with no activity over the last few business days.

If anyone has gotten this to work with the current (August 2024) release of Shopify, would you please share what you did and any tips you discovered to make it work?

Thank you kindly.

from where are you importing the customers and metafields?

The import is a CSV file constructed using the Shopify template extended with the metadata field headers as per Shopify online documentation.

The source for the import is a CSV file based on the Shopify template. The additional columns have been added and named as per the Shopify documentation to import customer metafields, but the import function says that they are invalid.

Any such customer metafields for importing must already exist in the admin

and be a specific type

https://help.shopify.com/en/manual/customers/import-export-customers#supported-metafields

Also make sure the CSV itself is free of errors, otherwise be more exact with whatever error messages are showing and where and how.

Hi Paul,

The customer metafields do exist in the admin. I followed the instructions exactly to create the column headers in the import CSV using the data from the naming from the customer metafields exactly. In this scenario, all the metafields are single line text which is supported per the link that you provided. The failure occurs during the Preview phase of the import where it says that the fields do not exist, even though they do.

Thanks for trying to help

Have you tried exporting then reimporting the exact CSV shopify gives when it includes metafields to check your syntax

https://help.shopify.com/en/manual/customers/import-export-customers#supported-metafields:~:text=Optional%3A%20If%20you%20want%20to%20include%20customer%20tags%20or%20supported%20metafields%20in%20your%20export

Hi Paul,

That’s a good suggestion, I will do that and see what I learn, and update this post.

Thank you!

Hi Paul,

Thank you for the suggestion. I discovered that the documentation was not completely clear. Your idea gave me the full field names and the import worked as hoped.

Thank you very much sir.

1 Like

I attempted to export my customers but the custom metafield did not export. Do you have any more info since you got it to work?

edit: Nevermind, I finally figured it out

For all others playing at home. I have dropped a few hours on this today. The information is ‘kind-of’ in the documentation, but it is not as clear as it should be. Things I learned.

I put the CSV columns in the exact order that the default fields and metafields columns are in, in the Shopify metafile settings and sample export CSV file.

The CSV column heading in your import file must have the exact syntax. When I created one of the metafields, it was assigned an identifier of custom.customer_number . I assumed, incorrectly, that this would be the column heading for the csv import file, but I eventually discovered that the column heading had to be customer.metafields.custom.customer_number , because I was importing into the Customer module. First trap for young players.

The second trap is that at the time that I was doing my importing and exporting, only six specific data formats out of the available 26 data formats for metafields are supported for importing and exporting to CSV files. (no, I don’t understand why this is the case either - probably to support the external Shopify App community so you are ‘encouraged’ to purchase another App to support this usability). So, if your metafield is set up with a type other than Boolean, Date, Date and Time, Integer, Decimal, Single line text; then it will neither import nor export in the version of Shopify I am using at the time of writing. Hopefully this will be remedied soon.

My Third mistake was related to the country codes. The ISO reference page provided shows three different options for each Country. For example; Australia has AU, AUS or 036. It would appear that Shopify only accepts the two digit version of the ISO codes. I was using the three digit in my initial upload.

My next challenge is that I did three uploads, to get some corrected data in from my CSV file (one of the entries had multiple lines in one of the metafields, which Shopify does not currently allow. Even though I decided to not overwrite customers existing records, somehow, Shopify imported eight customer records instead of one; thereby duplicating seven records which I now need to find - an annoying task in itself, because I cannot seem to sort the customer records by customer name - I am still trying to mentally come to terms with this. I can only assume I am getting something wrong.

Finally, a simple suggestion for Shopify Developers - If you look back to pre-1980’s computing practices, you will see this really neat trick for importing date into an existing database. It involves a processing called “mapping”. Try to stay with me here; what you do is, when the user uploads a file, you present the user with a list of the available fields in your database (the fields to which data can be imported) and then next to each of those fields you have a dropdown box of all the available fields from the CSV import file, and, you have preselected the field you feel most likely corresponds to the relevant field in your database, or you have left the dropdown box blank if it is unclear what the mapping should be. The user can then leave a dropdown box blank - that field is not being imported, agree with the preselection already made - well done Shopify AI, or select another field from the dropdown box to match the existing database field with the field (column name) being imported from the CSV. Of course, data type checks can be done to warn a user that they are trying to import a URL into a Date field, or text in to and integer field, and so on. Grab any computing book from the 1980’s; it will be in there somewhere. And while you are at it, would be great to increase the number of supported metafield types, preferably to 26.

Other than that, enjoying my learning process.

1 Like

thank you for clarity on the metafield setup. I was having a similar issue. Do you have any tips for matching up customer order data to imported customers?

Shopify have introduced metafields import export in Native Shopify CSV fie. Here is guide

https://youtu.be/iAfJN-4iMpc