Hi everyone, does anyone know how RebuyEngine works correctly? Especially when I’m using headless? My store is developed with headless, and it’s causing a lot of problems when trying to do anything in Rebuy. My team and I want to implement the functionality of automatically adding a gift to the Shopify cart, but because it’s headless, it doesn’t work. Does anyone know if there’s a way to implement this functionality? Do I need to add any parameters or anything? I’ve tried the Rebuy documentation, but it only mentions inserting a script into my store’s theme. I’ve tried it, and it hasn’t worked.
Hello, @sebas07
The problem is that Rebuy will not work well on headless since most of their features (gift with purchase, auto add to cart) require them to interact with Shopify theme scripts and the DOM, which does not exist in a headless build. This is precisely why including the code provided by them does nothing. In a headless build, you would have to do this programmatically using the Storefront API, Cart API, or even Shopify Functions to apply a 100% discount to some products as gifts based on your criteria. To summarize, Rebuy could be helpful for recommendations through the API, but for automatic actions such as gift giving, you would have to implement them yourself on a headless platform.
Best Regards