Skip to main content
Solved

Connecting Klaviyo to Shopify Hydrogen


Forum|alt.badge.img+4

Hi Thanks to all for having a look.

I am trying to get up and running with Klaviyo on Hydrogen. Not sure what order to put the  <KlaviyoOnsite /> component in App.server.tsx?

I see from the example repo here https://github.com/klaviyo-labs/klaviyo-shopify-hydrogen-example

That it is nested in the LocalizationProvider but I don’t have this in my file?

 

I did look at these docs too.

https://developers.klaviyo.com/en/docs/integrate-with-a-shopify-hydrogen-store#connect-klaviyos-native-shopify-integration

Best answer by alex.hong

This guide on our Developer Portal seems to outline the process: Integrate with a Shopify Hydrogen store.
 
According to this, you need to integrate Klaviyo with Shopify as normal, and then install the various scripts necessary for the features you are looking to incorporate.

View original
Did this topic or the replies in the thread help you find an answer to your question?

8 replies

alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • October 3, 2022

Hi there @Changnoy ,

Welcome to the Community and thanks for sharing.

That’s interesting. Have you tried restarting the integration process and looking there to see if your files are there?
If so, I can look into it with our dev teams.


Forum|alt.badge.img+4
  • Author
  • Contributor II
  • 3 replies
  • October 3, 2022

Hi Alex,

 

Thanks for the reply. No sure what you mean what files? Do you mean starting integration from Shopify admin first?


Forum|alt.badge.img+4
  • Author
  • Contributor II
  • 3 replies
  • October 3, 2022

I don’t have the LocalizationProvider in the demo-store so not sure where to nest KlaviyoOnsite , I nested it under EventsListener as a guess


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • October 3, 2022

Hi @Changnoy ,

Referring to the entire integration itself, starting clean from the beginning and seeing if reinstalling the integration would help. 


Forum|alt.badge.img+4
  • Author
  • Contributor II
  • 3 replies
  • October 3, 2022

@alex.hong 

Thanks for your help, maybe this is above my skill level I just wanted to try to take it 1 step at a time. 

Using the code from this repo linked in article. https://github.com/klaviyo-labs/klaviyo-shopify-hydrogen-example

I copied the files into my project then went to next step adding initial Script.

The first challenge I faced was in App.server.tsx  https://github.com/Shopify/hydrogen/blob/v1.x-2022-07/templates/demo-store/src/App.server.tsx there is no Layout function like the example in the repo.

 

So to clarify my question how and where do I add initial Script that is my current challenge.

 

I have a general working knowledge of React but am new to Klaviyo and Hydrogen

Thanks 


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • Answer
  • November 7, 2022

This guide on our Developer Portal seems to outline the process: Integrate with a Shopify Hydrogen store.
 
According to this, you need to integrate Klaviyo with Shopify as normal, and then install the various scripts necessary for the features you are looking to incorporate.


Forum|alt.badge.img
  • Contributor I
  • 1 reply
  • October 11, 2023

Hi there! Curious if anyone knows if there are workaround using the existing shopify x klaviyo integration code rather than needing to rebuild out using what’s provided on the dev page?


Brian Turcotte
Forum|alt.badge.img+37

Hi @Aliciacj17!

 

At this time, the only supported integration with shopify hydrogen is the one described in the developer docs here, but I will update the thread if anything changes!

Best,

Brian