Klaviyo - Onsite tracking with Klaviyo's JavaScript
The video provides a step-by-step guide on integrating Klaviyo's JavaScript (JS) into a website to track visitor behavior and custom events. It begins by explaining the importance of tracking on-site activities such as browsing, adding items to carts, and more, which can be automatically tracked through native integrations like Shopify. For custom integrations, users must manually add the Klaviyo JS snippet to their site. The process involves obtaining a public API key from the Klaviyo account settings and inserting the JS snippet into the site's HTML. This snippet enables the tracking of on-site events and the use of Klaviyo forms. The video also covers how to use the Klaviyo object to identify profiles and track custom events, such as a 'ViewedPage' event, by adding specific code snippets to the site. The tutorial concludes with a demonstration of testing the setup to ensure that events are tracked correctly, highlighting the benefits of gaining insights into customer activity through on-site tracking.
Key Points:
- Integrate Klaviyo JS by adding a JavaScript snippet to your site's HTML to track visitor behavior.
- Obtain the public API key from Klaviyo account settings to use in the JS snippet.
- Use the Klaviyo object to identify user profiles and track custom events like 'ViewedPage'.
- Test the setup by checking if the events are correctly tracked in the Klaviyo profile.
- On-site tracking provides valuable insights into customer activity, enhancing marketing strategies.