Shopify Email Marketing: Require marketing consent during registration

Running marketing campaigns on Shopify needs of a consent from your customers to receive promotional emails. You can require this consent during registration with a checkbox
Froonze
December 25, 2023

Email Marketing is one of the most important assets to connect and engage with your audience.If you collect the marketing consent during registration you can create segmented campaigns. And target customers based on relevant criteria. Because Shopify stores customer data when customers create an account. Like purchases, products and location, to name a few of the standard fields, that you can use to drive your campaigns.

Customer data and customer segmentation offers many opportunities to target your customers. And drive relevant campaigns based on their preferences and past activities. Such as upcoming sales or promotions, restocking announcements, new products. Or discounts on items they've purchased before or left in their carts.

With this guide you'll learn how to quickly add a required "Subscribe to Marketing" (or "Accepts Marketing") opt-in in the registration form. Please note that this method requires you to have Shopify Customer Accounts enabled in its Classic version. The New Version currently doesn't allow collecting marketing consent during registration.

How to require Marketing Consent with a checkbox during registration

  1. Go to your Shopify admin and navigate to Online Store > Themes. Find the theme you want to edit and click on Edit Code
  2. In the Theme Editor, search for the word "register". This will bring up the element that contains the login form, ending in .liquid. It's usually the template register.liquid or the section main-register.liquid. Open it.
  3. In the panel on the right side, search for "submit" to find the submit button. It's usually contained in a <button> tag or an <input type="submit">, just below the password input.
  4. Above the submit button or input, paste the code below. You can consider changing the wording of the messages to suit your interests better. ("Subscribe to email marketing", "You must subscribe to Marketing to register an account"). Then Save.
  5. Test the functionality by creating a new account on the registration page on your site. You should also test that if you untick the Marketing checkbox, you won't be able to submit the form and an error message will show up. If everything went well, once you create the account, the new customer show up in your Shopify Customers panel with a "Subscribed" badge.

<div class="accepts-marketing"> <input type="hidden" name="customer[accepts_marketing]" value="false" /> <input type="checkbox" name="customer[accepts_marketing]" value="true" checked="checked" /> <label for="accepts-marketing">Subscribe to email marketing</label> <p class="errorMarketing" style="display:none; color: #c40000">You must subscribe to Marketing to register an account</p> </div> <script> document.addEventListener('DOMContentLoaded', function() { const markInput = document.querySelector('.accepts-marketing input[type="checkbox"]'); const markError = document.querySelector('.errorMarketing'); const formSubmit = document.querySelector('#create_customer > button'); const formSubmit2 = document.querySelector('#create_customer > p > input'); markInput.addEventListener("click", () => { if (markInput.checked == true) { if (formSubmit) {formSubmit.disabled = false}; if (formSubmit2) {formSubmit2.disabled = false}; markError.style.display = "none"; } else { if (formSubmit) {formSubmit.disabled = true}; if (formSubmit2) {formSubmit2.disabled = true}; markError.style.display = "block"; } }); },false); </script>

"Accepts Marketing" checkbox in Shopify registration form

Is there a no-code solution?

For a no-code solution you would need to resort to third party apps that can both collect the consent and make it a required step to submit the registration form.

If you are not familiar with code or wish to have a more straightforward solution, you should try our Custom Forms plugin. This plugin allows you to create custom registration and profile forms to collect the marketing consent. And any other additional information you need from your customers. This information is already saved in Shopify customer metafields, where you can use it to segment your customers.

Learn more about this plugin here: Custom Forms: collect all data you need from your customers

Some good questions

Can I make it not required ?

Yes. From the code above, you just need to omit all the code between the script tags: <script>...</script>

Consent during checkout or require login before checkout?

To ask for marketing consent during checkout you can use the built-in Shopify feature. You'll find it in the Shopify Settings > Checkout > Marketing Options. It's an optional consent, you can know more details about it here.

Alternatively you can require your customers to log-in or sign-up before checkout. This way you'll make sure that they have created an account and subscribed to marketing before completing the purchase. Of course, you must consider along if requiring login at checkout step adds enough value to your interests to potentially sacrifice purchase completion rates. If you want to know how to enable this feature you can visit this link.

Collect consent with opt-in in footer

Most Shopify themes have an option to add a newsletter opt-in in the footer that collects both email addresses and consent. But collecting it during registration will open more options to collect data. For you to personalize your email campaigns based on relevant customer data.

Marketing Consent and New Customer Accounts

Shopify's New Customer Accounts use password-less login, which means that customers don't need to fill a form to login or sign up. They access with a code sent to their emails. Accounts created this way have an Unsubscribed marketing status and it's not possible to modify this behavior.

Froonze Customer Accounts Concierge
Get the app today
Turn the account page into a beautiful portal with
Froonze Customer Accounts Concierge
  • 190+