I’m working on a website for a business I’m starting.
I setup an API call on the homepage for people to subscribe to a newsletter for when we’re launching our newest product. It’s connected to a Klaviyo account that is gathering the emails. When I run the code locally it works just fine and posts the data, however when I run it on the Netlify servers I still get a ok 200 code, but nothing gets posted to Klaviyo.
Things I have tried to fix the error.
- Made sure the Klaviyo information is added to the environment variables on Netlify.
- Console logging the data to make sure it is getting passed correctly. However I don’t know how to see that information when its hosted through Netlify, I can only see it is going through correctly on my local branch.
- I’ve tried to find similar related posts.
I don’t have any DNS issues, or any Build problems that I can tell. Logs are clean and the website runs fine, and gets a 200 ok response. but the data doesn’t show up in Klaviyo unless sent from localhost.
I’m pretty new with Netlify and API calls in general so there might be something obvious I am missing, any help would be appreciated. Thanks