Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi there
Does adding:
<input type="hidden" name="customer[tags]" value="newsletter">
to the "customer" form, magically make those customers appear in the "Accepts Marketing" section of the admin, or do I need to add accepts_marketing as a hidden field with value true?
In the examples of newsletter forms I've seen, including the official starter theme, there is just a tag of newsletter. The theme I'm working on doesn't use sections, if that makes any difference.
TIA
Jamie
Solved! Go to the solution
This is an accepted solution.
For anyone else stumbling on this post, it seems that "Accepts marketing" is set by default just by using this form type:
{% form 'customer' %}
It would be useful if this was documented along with the fact that you need to use "contact[]" and not "customer[]" field names with this form. The documentation could be improved further by explaining what happens when the customer is already added. For that it seems, the behaviour is to just reload the page with the parameters in the URL and supply no form errors.
I think this is the info you're looking for:
https://help.shopify.com/en/themes/customization/forms/get-consent-for-promotional-emails
See step #5 specifically.
Hope that helps
This is an accepted solution.
For anyone else stumbling on this post, it seems that "Accepts marketing" is set by default just by using this form type:
{% form 'customer' %}
It would be useful if this was documented along with the fact that you need to use "contact[]" and not "customer[]" field names with this form. The documentation could be improved further by explaining what happens when the customer is already added. For that it seems, the behaviour is to just reload the page with the parameters in the URL and supply no form errors.
To expand on ib3's comments: it seems you can add any arbitrary customer field to the form and it gets saved in the customer record. For example, if you wanted to add inputs for first and last name to the newsletter form, you could do that with HTML like this:
<input type="text" name="contact[first_name]" placeholder="Enter your first name">
<input type="text" name="contact[last_name]" placeholder="Enter your last name" >
Here's the customer account it created
I not finding any solution to add a phone number to the customer overview section. Anybody has solved this issue
That should be possible yes.
Admittedly, I'm not quite sure what you mean by the "customer overview" section. Is this when creating the account? In a newsletter form? Customer edit page?
It's best if you can upload a screenshot of where you want this to show up, and include the URL bar in the screenshot. A link to your actual store would be even better.
In any case, I'd bet that the solution described in my forum post above will work. Have you tried that already? If so, screenshot your Liquid so we can see what didn't work and advise accordingly. We're all learning this stuff together 🙂
Hey Eric,
Sorry to jump in on this, but have you got this working with Dawn theme?
I haven't tried yet with the Dawn theme, but it should work exactly the same way. Just add an input with a name like:
name="contact[first_name]"
I say should because the handling of those form inputs is all handled server-side, independently of what theme you're using. I guess it's possible the handling is different for Dawn vs Debut, but that seems highly unlikely.
In any case, let us know if you end up trying it / whether it worked or not.
Hi, I tired to put this html into an existing page and it would not take....just stayed as html code. what am I doing wrong? I have the checkbox on the cart but I wanted to put the sign up to newsletter in my blog and on a couple of other pages. I use the Supply theme. Thanks for any help that you can offer!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025