Back to all articles
Photo of Niki, the author of this blog post
Niki · 31 August 2023

How to add a newsletter subscription checkbox to your customer registration form on Shopify?

When you enable customer registration on your Shopify store, you might want to give your customers the option to subscribe to your newsletters and receive marketing emails. However, if you take a look at the standard registration form, you might notice that the checkbox for this purpose is missing in many themes. For instance, the Dawn theme doesn’t include the checkbox in its default registration form.

But don’t worry! Adding the checkbox for newsletter subscription to the registration form is actually quite simple. Follow this guide to set it up – even if you’re not too familiar with technical stuff, you can do it! And as usual, we’ll walk you through the process using the Dawn theme as an example.

Locating and modifying the customers/register.liquid gile to include the checkbox

  1. Go to your Shopify admin -> Sales Channel -> Online Store -> Themes.
  2. Among the list of themes, select the one you want to modify. Click the three dots located adjacent to the “Customize” button for that theme.
  3. From the dropdown menu, select “Edit code”. This will open up the theme’s code editor.
  4. Look for the “customers/register.liquid” file. This is the file that controls the content and layout of the customer registration form.
  5. Scroll down within the “customers/register.liquid” file until you reach the conclusion of the code. Just before the opening <button> tag, insert the following code snippet:

    <div class="accepts-marketing">
       <input type="hidden" name="customer[accepts_marketing]" value="false" />
    
       <input type="checkbox" name="customer[accepts_marketing]" id="accepts-marketing" />
       <label for="accepts-marketing">
         Subscribe to email marketing
       </label>
     </div>
    
  6. Once you’ve added the code, don’t forget to save your changes.

Customizing the newsletter subscription checkbox

To ensure that the newsletter subscription checkbox integrates seamlessly into your customer registration form, you can customize its appearance and behavior. Here’s how you can make some adjustments:

  • It’s a good idea to create some space between the checkbox with its label and the submit button. This makes the layout more visually appealing. You can do this by adding some margins.
  • While the checkbox and label are clickable, making the cursor change to a pointer when hovering over them enhances user-friendliness. To achieve this, you can apply a CSS class to both the checkbox and the label. Here’s how you can do it:

     .subscribe_register {
        cursor:  pointer;
      }
    
  • If you wish to have the newsletter subscription checkbox pre-selected (checked) by default when customers visit the registration page, you can achieve this by adding the “checked” attribute to the <input>checkbox element.
  • Modifying the label’s wording on the newsletter subscription checkbox is a straightforward task – you can simply adjust the text within the <label> element in the code.

Testing the checkbox

With the code in place and the changes made, now let’s see if the new checkbox is working right. Follow these simple steps to make sure everything is okay:

  1. First, subscribe a new customer using the registration form you updated.
  2. Then, navigate to Customers in your Shopify admin.
  3. You’ll notice that your new customer is listed right at the top. You will see a green label that says “Subscribed” or “Pending”. This depends on whether you’re using double opt-in for marketing. A newly created customer with the subscribed label
  4. If you click the customer details, you will also see information that the customer has been subscribed to email marketing (or that the confirmation is still pending). Customer details – subscribed to a newsletter
  5. Don’t forget to test the process for another customer, but this time, don’t check off the checkbox.

Let’s take a look at the outcome!

The following screenshot showcases the registration form, now enhanced with the inclusion of the newsletter subscribe checkbox. It allows customers to easily decide whether they wish to receive newsletters and marketing emails right from the point of registration.

Adding a checkbox for subscribing to newsletters to a customer registration form

Have a project in mind?
Get in touch
Drop us an email to

hello@ecommercepot.com

and one of us will get back to you soon.