We are working on a custom APP which will tag orders after certain actions. Basically, after we processed an order (transactional email integration with SalesForce) we want to assign a tag e.g. “email_order_create:xxxx” to the order. We using GraphQL mutation::tagsAdd endpoint to tag the order, which works but not consistent.
We log response for each “tagsAdd” call, none of them indicates an error, but sometime the order is not tagged correctly (after the “success” tag adding response, we check the order in both admin and via get order API, the tag is not there even the response saying nothing in error), here is a few example add tag responses:
Again, it’s working but just not consistent, which make the trouble shooting hard since we are not able to identify what’s causing the inconsistency. Can any one help or share some idea in how to trouble shooting this type of issue?
I can help you troubleshoot this. When an order is not tagged, can you note the x-request-id from the header and post it back to me? That will help me see what is happening behind the scenes. Do you have any other flows that run that could introduce a race condition?
We’re also experiencing something similar. We add tags to orders in orders/paid webhook. Most of the time the tags are added correctly, but sometimes they are not. Also There’s no error in the response.
I might be able to get the X-Request-ID if that’s helpful.
I’m also experiencing a similar issue but in my case a tag is not being added in a consistent manner.
Here’s the query:
mutation addTag {
tagsAdd(id: "gid://shopify/Customer/
The response:
```javascript
{
"tagsAdd": {
"node": {
"id": "gid:\/\/shopify\/Customer\/
"CUSTOMERS_UPDATE" webhook is triggered and tag is not present on the customer. The "X-Request-ID" is "7e281034-1470-477d-8d22-c1ac9919f4e2".
Can somebody from Shopify look into this issue? It’s a serious problem, it looks like customer tags work, but sometimes it takes few hours to see new tag in the user profile. I don’t think so, that it’s expected behavior.
Hi all, Just to let you know our team have opened an issue related to this with our developers. Thank you for bringing it to our attention. We hope to have a further update for you shortly.
Hi @ShopifyDevSup , thanks for your answer. I have additional information. I always use tagsAdd and tagsRemove mutations and I noticed following issues:
After customer tag is added via API, I can’t see it for a long time on customer card in Shopify admin, sometimes it takes few hours to update it.
After customer tag is added via API, when I tried to retrieve customer with tags using API (customer query) tag previously added is not present, but when I try to retrieve subscription contract using subscriptionContract query with user details (including tags), tag is present immediately.
When customer tag is added in Shopify admin it’s also immediately present in customer query results.
When order tag is added via API it’s rather immediately present in order query results, but for small amount of time, I think 5-10s the whole order is not present in orders query results with customerId andtag (just added via API) filters for query param.