I am trying to make my custom application to listen for webhooks from Shopify.
I need to receive customer ID on customer login. Unfortunately Shopify don't have built in functionality.
Is there any way I can achieve this?
Thank you
I am trying to make my custom application to listen for webhooks from Shopify.
I need to receive customer ID on customer login. Unfortunately Shopify don't have built in functionality.
Is there any way I can achieve this?
Thank you
There is no webhook for customer login natively available. we can manually trigger web-hook by our custom logic.
Logic
when the
customerobject is available on the page, we check if we have already called thewebhookor not.loginWebhook to trueland on theaccount page` after login every timeloginWebhookif it'struewe call webhookloggedto1so next time we don't call the webhookNow user will surf the site, and all that time we will not call the webhook as we already called it and store info into localStorage.
If the customer will
logoutthen we remove theloggedvalue from localStorage.So, Now next time when a user logs in we will again call
webhookand we repeat from the top.Implementation in live-action [Shopify Customer Login Webhook]
if any doubt please comment.