Custom Storefronts (Hydrogen, Headless & more)
Why Custom Setups Are Different
What’s Required for Tracking to Work
Manual Session Token Sync (Required)
export async function checkTokenToCustomer(cartIdGid, shopIdGid, providedCustomerId) {
let customerId = providedCustomerId || getCookie('2c.cId');
const cartToken = cartIdGid?.replace('gid://shopify/Cart/', '');
const shopId = shopIdGid?.replace('gid://shopify/Shop/', 'shopify-');
if (!customerId || !cartToken || !shopId) return;
const NOSTO_URL = `https://connect.nosto.com/token/${shopId}/${customerId}/${cartToken}`;
try {
await fetch(NOSTO_URL);
} catch (err) {
console.error('Nosto: error updating cart:', err);
}
}Last updated