- DarkLight
Collecting Customer Birthday Date from Shopify
- DarkLight
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:
- Open your Shopify store admin.
- Click Online Store.
- Click Themes.
- Click Actions > Edit code to find all the HTML and CSS of your theme. Locate the template called Customers/register.liquid.
- 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>
This is how it will appear on the register page on the site:
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.