Merchants commonly use Mechanic for adding or removing tags from customers, orders, products, and other Shopify resources.

Use a Shopify action like this one to (for example) easily add a tag to a customer:

{
  "action": {
    "type": "shopify",
    "options": [
      "update",
      ["customer", {{ customer.id | json }}],
      {
        "tags": {{ customer.tags | add_tag: "approved" | json }}
      }
    ]
  }
}

Or, to remove a tag, use something like this:

{
  "action": {
    "type": "shopify",
    "options": [
      "update",
      ["customer", {{ customer.id | json }}],
      {
        "tags": {{ customer.tags | remove_tag: "approved" | json }}
      }
    ]
  }
}

These examples use add_tag and remove_tag, which are Liquid filters unique to Mechanic. Learn more about our filters here.

Did this answer your question?