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
customer
object is available on the page, we check if we have already called thewebhook
or not.loginWebhook to true
land on the
account page` after login every timeloginWebhook
if it'strue
we call webhooklogged
to1
so 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
logout
then we remove thelogged
value from localStorage.So, Now next time when a user logs in we will again call
webhook
and we repeat from the top.Implementation in live-action [Shopify Customer Login Webhook]
if any doubt please comment.