Why is customer data missing in custom web pixel implementation?

Hi! The Customer ID on the checkout_completed event is accessible within event.data.checkout.order.customer.id, for example;

analytics.subscribe('checkout_completed', (event) => {
console.log("event", event)

const customerId = event.data.checkout.order.customer.id
console.log("customerId", customerId)
})

The customer’s first and last name should also be accessible within either the event.data.checkout.shippingAddress and/or event.data.checkout.billingAddress.

init.data.customer requires the customer to be logged-in on the storefront or the checkout, in order to be able to access the associated Customer object and Customer Account on the shop - perhaps this explains why you were not seeing any customer data in that case?

Hopefully this helps! Please let us know if anything else is still unclear here or if you have any other feedback regarding this.