Suppose, I need to notify my application on every user registration and login. In addition, I need to pass along some cookie of the current shop's customer.. So I can register a webhook with topic of 'customers/create' to pull off the registrations part. But alas, no cookie lookup doing it this way. And can't track logins either. Alternatively, I'm thinking on insertion of some custom js-snippet on every page (in theme's file) that would somehow detect that current page is one being displayed right after user creation/login, extract user_id via "Shopify" js variable, available on this page, and make http call to my backend. Does this path seem viable? Can anyone suggest if there's a better way to implement this?
↧