Missing webhook/event for products entering or leaving smart collections

Hello there,

We haven’t been able to find a solution to receive an event when a product enters or leaves a smart collection based on rules.

For example, we have a smart collection with a rule based on a specific product title. If the product title is changed on the product page, the rule becomes invalid for that product, and the product is removed from the smart collection. However, in this case, we do not find any webhook in your webhook list that indicates the product was removed.

We’ve already checked the following APIs as a potential workaround:

  • If we subscribe to the product/update webhook and fetch the collections immediately after receiving the event, the product still appears in the related collection. Only a few seconds later does the product actually disappear from that collection via API (
    For fetch product collections we tried the following APIs without success:
    product - GraphQL Admin
    collections - GraphQL Admin (hasProduct, products query)
    ).

  • We also do not receive any collection/update webhook for this change.

Because of this delay and the lack of a collection-related webhook, we currently have no reliable way to track when products enter or leave smart collections due to rule changes.

Do you have any recommendations or a solution for this case?

6 Likes

Hi @Levente_Kovacs,

I’ve looked into this and was able to replicate this on my own test store, with the collections/update webhook not being triggered when a product is added to a smart collection after editing the product itself to be in line with the smart collection conditions.

After discussing this with our developers, we can confirm that this is currently expected behaviour, and that the collections/update webhook is only triggered when there’s an update on the collection itself.

For example, with smart collections changing the collection condition will trigger the webhook, and with manual collections manually adding or removing a product will trigger the webhook as the update is done on the collection itself.

I do understand this is not ideal, and that our documentation isn’t very clear about this, and I will be reaching out to our team internally to update our Shopify.dev docs on the webhook topics to make this limitation more clear.

As for workarounds, there is nothing direclty I can recommend, however if you do need a regular update of smart collections, I may suggest periodically polling the collections via the API, and caching the results. For example, you can make a collections or collection query every 15 minutes or so, store the results of the last query, and compare it to the next query to see if any products were added or removed.

2 Likes

Thank you for the feedback. If I understand correctly, your team is not planning to enhance the corresponding webhook capabilities in the near future?

2 Likes

Hi @Levente_Kovacs,

While there are no plans at this time currently, I will be absolutely passing feedback internally on your behalf that you’d like to see this changed to include smart collection addition/removals triggering the webhook.

While we can’t guarantee when or if a feature will be added, I can assure you however that our developers do take all of our merchant and partner feedback into great value when determining future features and updates, and the more feedback we get for topics like this, the more likely it would be added.