Best place to load 3rd party scripts for all routes/pages? #1940
Answered
by
juanpprieto
this-alias
asked this question in
Help
-
Where is the best place within a Hydrogen app to load 3rd party scripts that run on the client-side on all routes/pages? For example, loading Klaviyo via loadScript:
|
Beta Was this translation helpful? Give feedback.
Answered by
juanpprieto
Aug 4, 2022
Replies: 1 comment
-
In this case, I would add it directly to the <body>
....
<script>
var _learnq = _learnq || [];
</script>
<script type="text/javascript" async src="//static.klaviyo.com/onsite/js/klaviyo.js?company_id=${PUBLIC_KEY}" />
</body> FYI — the team at klaviyo has put together this example repo I will be sharing an example in the future on how to integrate/init klaviyo |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
this-alias
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this case, I would add it directly to the
/index.html
FYI — the team at klaviyo has put together this example repo
I will be sharing an example in the future on how to integrate/init klaviyo
identity
andtracking
events from the server side.