Creating a Button that Updates Customer Tags

Topic summary

A user attempted to create a button that adds a “vip” tag to customers when clicked, but encountered issues with their Liquid code implementation.

Initial Problem:

  • Original code using customer[tags] didn’t work
  • Alternative attempt with customer[note][Membership] also failed

Proposed Solution:
One responder suggested preserving existing tags by joining them with the new tag:

value="{{ customer.tags | join: ', ' }}, vip"

They also explained the correct syntax for modifying customer notes if needed.

Core Issue Identified:
Another participant clarified that customer tags cannot be updated directly from the storefront due to Shopify security restrictions. Tags can only be modified through:

  • Shopify admin interface
  • Shopify API with proper authentication
  • Shopify Flow (for Plus merchants)
  • Third-party apps designed for customer tagging

Status: The original approach is not viable. The discussion remains open regarding which alternative solution the user will pursue.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

So I’m trying to create a button that adds a tag to an existing customer when they click on it.

{% unless customer.tags contains "vip" %}
{% form 'customer' %}

{% endform %}
{% endunless %}

I have tried this but it seems not to work so I changed it to

name="customer[note][Membership]"

but it also doesn’t add “vip” to Customer Note when the button is clicked.

Am I doing anything wrong here or this just doesn’t work with Shopify?

Hey @NguyenThiHoaCo ,

Let me help you with the customer tagging functionality in Shopify. The issue with your current approach is that the form is trying to overwrite the tags rather than append to them. Here’s the correct way to add a tag while preserving existing ones:

{% unless customer.tags contains "vip" %}
  {% form 'customer' %}
    <input type="hidden" name="customer[tags]" value="{{ customer.tags | join: ', ' }}, vip"/>
    <button type="submit">Subscribe</button>
  {% endform %}
{% endunless %}

The key changes are:

  1. We’re now including all existing customer tags using customer.tags | join: ', ’
  2. We append the new ‘vip’ tag to the existing tags list

As for the customer note approach (customer[note][Membership]), this wouldn’t work because the note field expects a different syntax. If you specifically want to modify the customer note, you would need to use:

{% form 'customer' %}
  <input type="hidden" name="customer[note]" value="{{ customer.note | append: ' VIP' }}"/>
  <button type="submit">Subscribe</button>
{% endform %}

However, I recommend sticking with the tags approach as it’s more structured and easier to manage. Tags are specifically designed for this kind of categorization in Shopify.

Let me know if you’ve any more questions for me :slightly_smiling_face:

Cheers!
Shubham | Untechnickle

Hi thanks so much for taking your time. However, I feel like neither of these work at all. Have you tested it on your end?

Hey!

You’re right—this approach won’t work because Shopify doesn’t allow customer tags to be updated directly from the storefront for security reasons. Customer tags can only be modified through the Shopify admin or via the Shopify API with proper authentication.

That said, you’ve got a few good options:

  1. Use native Shopify tagging – If you’re managing tags manually, you can update them in the Shopify admin under Customers.
  2. Shopify Flow (for Shopify Plus) – If you’re on Plus, you can automate tag updates based on certain triggers (like order history or logins).
  3. Use an app like Latch (disclaimer: I’m the developer) – Latch lets you automatically tag customers based on their actions, like subscribing or purchasing, making it easy to manage VIP access.

Hope that helps! Let me know if you need any more details.