Hi everyone,
I am working on a React base Custom Storefront for my Shopify shop using Klaviyo. In order to access Klaviyo’s object to push or identify a user, I am needing to load the Klaviyo object per page. According to the docs, it looks like I have to use this code snippet on each page that I want to use the object on.
This code snippet is not the cleanest looking and has a lot of abstraction on first glance.
I wanted to ask the community if there is a better way to implement this with React without having to load this snippet into each page or at the very lease, make it into a reusable component.
The documentation I am referencing in the screenshot is here:
https://developers.klaviyo.com/en/docs/introduction_to_the_klaviyo_object#how-to-load-the-klaviyo-object
Thank you guys for your help.
Best answer by KeviSunshine
View original