Skip to content

Best place to load 3rd party scripts for all routes/pages? #1940

Answered by juanpprieto
this-alias asked this question in Help
Discussion options

You must be logged in to vote

In this case, I would add it directly to the /index.html

<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 identity and tracking events from the server side.

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Help
Labels
None yet
2 participants