To install klaviyo.js into your project, copy the code snippet below and past it into the project code before the closing body tag.
Be sure to replace 'PUBLIC_API_KEY' with your Public API Key from Klaviyo.
<script type="application/javascript" async
src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY"></script>
You can add extra snippets of code to identify your customers with any information they have submitted.
<script>
var _learnq = _learnq || [];
_learnq.push(['identify', {
'$email': '{{emailAddress }}',
'$first_name': '{{ firstName }}',
'$last_name': '{{ lastName }}'
}]);
</script>
Additional tokens you can pass into Klaviyo
{{emailAddress}}
{{firstName}}
{{lastName}}
{{this.phoneNumber}}
{{city}}
{{postalCode}}
{{state}}
{{country}}
{{sf-session-id}}
Please visit Klaviyo developer documents for additional information
Select the code editor in Subscribe Funnels
![klaviyo-step1.jpg](/hc/article_attachments/360053557194/klaviyo-step1.jpg)
Paste the Klaviyo code into Subscribe Funnels
Place the scripts at the end of your code.