Update Your Customers Email Marketing Status

As of April 2022, Shopify has changed how email marketing consent works on its platform. Shopify has migrated a single field called accepts_marketing to two fields called email_marketing_consent.state and email_marketing_consent.opt_in_level. The display on your Shopify Customer dashboard will look the same, but the data behind the scenes has changed.

With this new change, the buyer_accepts_marketing field on the Order no longer updates the marketing consent fields on your customer. To keep backward compatibility and prevent unnecessary complexity, we have decided to leave the buyer_accepts_marketing field on the Order and will use this field to update the customer for you. EZ Importer will set the state and opt_in_level values for you. The app will also make a second call to the Customer API, which will decrease your import speed on large imports.

Although not ideal, we think this is a good trade-off since you only need to provide a single value to set your customers' email marketing consent, and it's backward compatible with your existing imports.

Marketing Consent Values

As mentioned above, Shopify now has two new fields in place of a single true/false value for email marketing consent. EZ Importer will use the buyer_accepts_marketing flag on the Order to update these fields.

  1. State - This field is used to keep the state of your customer's marketing consent. The three possible states are; not_subscribed, unsubscribed, or subscribed. If your customer has given you consent to send them marketing emails this value will be set to subscribed. If they gave you consent previously, but have unsubscribed then the value should be set to unsubscribed. If you haven't asked for their consent then it should be marked as not_subscribed.
  2. Opt-In Level - This is the opt-in level of the consent. The opt-in levels are; confirmed_opt_in, single_opt_in or unknown. If your customer has confirmed their opt-in, sometimes called double opt-in, the value should be confirmed_opt_in. If your customer agreed to marketing emails but you did not provide a confirmation step, it should be set to single_opt_in. Lastly, if your customer has opted in, but you're unsure how they've opted-in you would use unknown.

We have to make a few assumptions since we're using the buyer_accepts_marketing flag on the order to update these Customer fields, and they don't map cleanly.

  1. State - If you've set the buyer_accepts_marketing flag to true, the email marketing consent state field will be subscribed. If you have it set to false and the marketing consent state flag isn't currently set to not_subscribed, EZ Importer will set the value to unsubscribed. If the customer is marked not_subscribed and you have provided a false value for buyer_accepts_marketing EZ Importer will not update this field, leaving the customer as not_subscribed.
  2. Opt-In Level - If the buyer_accepts_marketing flag is true, we'll set this to single_opt_in. We feel this is the best value to use for this case. It's also the default Shopify has used in the past, and we believe this gives us the most consistency.

If these assumptions don't work for you or if you need more accuracy when setting the email marketing consent fields, we recommend you do not enable the buyer_accepts_marketing flag and use Shopify's customer import tool to update your customer's email marketing consent values.

We may add these fields to the customer data mapping in the future to give you more flexibility.

Performance Implications

Due to this change, if you have the buyer_accepts_marketing enabled, we need to make a second call to Shopify's Customer API for every Order you're importing. In the past, Shopify would update the Customer fields for us using the Order API. Now, EZ Importer needs to update the Customer fields directly, which means we need to make a second call to Shopify for every Order in your file.

You may not notice a difference in smaller imports, but you will see a difference when running large imports. We recommend you do not enable the buyer_accepts_marketing field on large imports. Our testing has identified noticeable slowdowns on imports bigger than 10,000 orders.

If you have further questions about large imports consult our large import documentation or feel free to reach out to us.


App: EZ Importer

Tags: customers, getting started