Collecting Customer Birthday Date from Shopify

      Collecting Customer Birthday Date from Shopify


        Article summary

        Products


        Loyalty & Referrals
        Supported plans

        Pro, Premium, Enterprise

        eCommerce Platform

        Shopify, Shopify Plus

        Rewarding a customer on their birthday is a great way to engage with them and foster a personal level connection.

        There are two ways to collect the customer's birthday on Shopify, one is through our onsite earning points module, and the other is to collect it directly in Shopify when the customer signs up. We are able to pull the birthday date directly from Shopify.

        if you do this directly in Shopify, you don't need to rely on the customer discovering your birthday reward earning rule and entering their birthday, you can just have it from the start. 

        In this article, you'll learn how to set up birthday capture on Shopify. We achieve this by adding a birthday field to the create account form on your Shopify store.

        Adding code to register.liquid

        The first step is to add some code to your Shopify registration page. To do this, do the following:

        1. Open your Shopify store admin.
        2. Click Online Store.
        3. Click Themes.
        4. Click Actions > Edit code to find all the HTML and CSS of your theme. Locate the template called Customers/register.liquid.
        Please note:
        This example contains the most frequently used file names. Don't worry if you can't find it. You can either explore the files on your own until you find the right spot, or you can use the online support form to contact our support team to help you find the way.

        1. Paste the following code where you want it to appear on your page in relation to the other page elements. For example, if you want it to appear at the end of your other input fields, paste it after your last input field, and before the submit button.
        <div id="birthday-wrapper" class="clearfix large_form">
        
        <label for="birthday" class="label">Birthday</label>
        
        <input type="date" value="" name="customer[note][birthday]" id="birthday" class="text" size="30" /></div>
        Date format
        For US merchants the date format we expect is mm-dd-yyyy. For all other merchants, the date format we expect to receive is dd-mm-yyyy. We determine the country by Shopify's shop.country_code attribute

        This is how it will appear on the register page on the site:

        Important!
        The birthday field is added as a note to the customer profile - this is how we get the data onto Yotpo. Once the customer adds their birthday, we capture it. If there is a birthday reward earning rule running - they will not need to insert their birthday again in the rewards page and will see the earning rule as completed.

        Updating a Birthday on Shopify Admin

        The merchant can also update the customer’s birthday in Shopify’s admin - this will update the birthday on our end as well. The update happens in the customer note section. The merchant should not change the format of the Y-M-D otherwise we might capture incorrect dates.


        Was this article helpful?