How to collect SMS consent at checkout on Shopify

Last updated at:

You will learn

Learn how to collect SMS consent at checkout on Shopify by updating your Shopify integration settings and then adding a consent checkbox in Shopify. One of the quickest and easiest ways to grow your SMS list is by collecting consent at checkout. With Klaviyo’s integration with Shopify, you can leverage this approach and reach a wider audience with your SMS marketing. 

Before you begin

You can only collect SMS consent in locations where Klaviyo SMS is available. You also must have a sending number for the location where you're collecting consent. 

Before you begin gathering SMS consent at checkout, you need to:

Remove code snippet from Shopify's checkout.liquid file

This section only applies if you previously added a code snippet to the checkout.liquid file to set up consent at checkout.

If you never set up consent at checkout for Shopify, skip to the next section. 

Instructions for removing the code snippet
  1. In Shopify, navigate to Themes > Actions > Edit Code
    Shopify home page when the Actions dropdown is open
  2. Click into checkout.liquid on the left.
  3. Search for "Klaviyo" to locate the correct code snippet, as it can be located anywhere in this page. For our example, it is located at the very bottom and appears as:
    <script async type="text/javascript" src=""></script>
    Checkout.liquid file with the Klaviyo with the code snippet
  4. Click Save

In Klaviyo: update your Shopify integration settings

The first step to collecting SMS consent at checkout with Shopify is changing your integration settings.

  1. Click your account name in the bottom left.
  2. Select Integrations.
  3. Select Shopify from the list of enabled integrations.
  4. Under Sync data from Shopify, check the box Sync your Shopify SMS subscribers to Klaviyo.
  5. Select the list you want to add your SMS subscribers to. If you are also collecting email subscribers, assign a separate list to each channel, so that consent will get applied properly when subscribers sync into Klaviyo.
    Shopify integration settings page in Klaviyo showing Sync data from Shopify and Sync data to Shopify sections
  6. Recommended: under Sync data to Shopify, select All profiles and SMS subscription status. We also recommend checking Name, email address, and phone number and Email subscription status, if you have not done so already. 
    • If you choose the SMS subscription status option (and you choose to sync all profiles) a backfill of all SMS subscription statuses and associated phone numbers will occur after you integrate to ensure Klaviyo and Shopify are in sync.
  7. Click Update Settings, which will bring you to your Shopify store.
  8. Review the changes and click Update App.
    Page in Shopify showing permissions for Klaviyo with update app with green background at the bottom

In Shopify: Add SMS consent collection to checkout 

The next step is adding SMS consent collection at checkout in Shopify. 

  1. In your Shopify admin, click Settings at the bottom of the left sidebar.
  2. On the Settings page, click Checkout.
    Settings page in Shopify admin with all cards grayed out exception for the Checkout card, which has a white background
  3. In the Marketing Consent Show an option to subscribe at checkout for SMS marketing.
    Marketing consent setting in Shopify with show an option to subscribe at checkout under SMS marketing checked off
  4. Scroll down to the bottom of the page and click Save.


Your checkout page will now have a section similar to the one shown below. 

Shopify checkout page showing checked box reading text me with news an offers, with a text box to enter phone number

Now, consent will now start syncing to Klaviyo when someone does all of the following steps:

  1. Enters their phone number.
  2. Selects the checkbox to accept SMS marketing.
  3. Clicks Continue to shipping.

If the list is set to double opt-in, which is strongly recommended, customers will have to confirm their subscription before SMS consent is added in Klaviyo. The only exception is when you're using a branded sender ID, which always uses a single opt-in approach since it can't receive messages. 

The customer do not need to complete their order to have their consent synced to Klaviyo. Thus, you can more easily and quickly grow your SMS list.

Consent will only sync to Klaviyo if the person is subscribing to SMS in Shopify for the first time.

If you already have SMS subscribers in Shopify, you can export them into a CSV file and then import them into Klaviyo

Additional resources

Was this article helpful?
146 out of 214 found this helpful