How to include custom data into the data send to the backend by webhook event?

jkinson
Shopify Partner
3 0 0

I'm creating a Shopify app that will monitor the customer journey. Basically, my app is using the Shopify webhooks to notify my backend if a customer is adding items to the cart, checking out items, etc. Then my backend will create a JSON object in this format: 

 

{
  session_id: "",
  anonymous_id: "",
  user_id: "",
  context: {
    "page": {
        "referrerUrl": "",
        "urlPath": "",
        "urlTitle": "",
        "host": ""
    },
  },
  webhookData: {}, // the data from webhook
}

 

 My problem is most of the fields in the object above can only be gathered from the browser.

 

So, how can I send the browser gathered data together with the webhook event data?

Replies 0 (0)