App reviews, troubleshooting, and recommendations
I’m encountering an issue with the Shopify GraphQL API when trying to set up customization rules based on customer tags. Here’s the situation:
I’ve created a rule where users can specify a tag for a customer. This involves the following conditions:
The tag is successfully added and saved in the Shopify Admin under Customers Settings. However, when I query the hasTags field in the buyerIdentity.customer object, it is returning false for the hasTag property, even though the tag exists for the customer.
GraphQL Query:
query ($customerTags: [String!]) { buyerIdentity { email customer { email amountSpent { amount } hasTags(tags: $customerTags) { tag hasTag } } } }
run.graphql :
query RunInput($customerTags: [String!], $productTags: [String!]) { cart { discountCodes: attribute(key: "discountCodes") { key value } zoneProvince: attribute(key: "Zone") { key value } cost { totalAmount { amount } totalTaxAmount{ amount } subtotalAmount { amount } } lines { quantity cost{ amountPerQuantity{ amount } compareAtAmountPerQuantity{ amount } } merchandise { ... on ProductVariant { sku weight product { hasTags(tags: $productTags) { tag hasTag } } } } } deliveryGroups { deliveryAddress { provinceCode city countryCode } selectedDeliveryOption { cost { amount } } } buyerIdentity { email customer { email amountSpent { amount } hasTags(tags: $customerTags) { tag hasTag } } } } paymentMethods { id name } paymentCustomization { metafield(namespace: "$app:payment-customization-v2", key: "advance-rules") { value } } }
Result from Extensions Console:
{ "buyerIdentity": { "email": "userxyz@gmail.com", "customer": { "email": "userxyz@gmail.com", "amountSpent": { "amount": "0.0" }, "hasTags": [ { "tag": "TestingC-Tag", "hasTag": false } ] } } }
As you can see, the API is returning hasTag: false for the tag "TestingC-Tag", even though it exists in the Shopify Admin for this customer.
Question:
Why might the hasTags field be returning false for a tag that exists in Shopify Admin? how do i fix reslve it to use hasTag or is there any other solution to use CustomerTags?
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025