HTML Diff
3 added 4 removed
Original 2026-01-01
Modified 2026-03-10
1 - <p>Klaviyo has released a new JavaScript (JS) object that supports callbacks and promises, giving brands that<a>leverage our APIs</a>more visibility into when updates have been made to Klaviyo’s system. This gives you more control over the timing of customer-facing onsite experiences, such as the triggering of a sign-up form. </p>
1 + <p>Klaviyo has released a new JavaScript (JS) object that supports callbacks and promises, giving brands that<a>leverage our APIs</a>more visibility into when updates have been made to Klaviyo’s system. This gives you more control over the timing of customer-facing onsite experiences, such as the triggering of a sign-up form.</p>
2 <p><strong>The challenge</strong></p>
2 <p><strong>The challenge</strong></p>
3 <h2><strong>Callbacks or Promises-JS Object</strong></h2>
3 <h2><strong>Callbacks or Promises-JS Object</strong></h2>
4 - <p>All brands that track shoppers’ activity on their website and pass that data to Klaviyo have installed a JS object - either through the<a>integration between their ecommerce platform</a>and Klaviyo, or by manually adding a code snippet to their site. For the last ten years, the JS object that has tracked shopper activity and triggered sign-up forms is _learnq.</p>
4 + <p>All brands that track shoppers’ activity on their website and pass that data to Klaviyo have installed a JS object - either through the<a>integration between their ecommerce platform</a>and Klaviyo, or by manually adding a code snippet to their site. For the last ten years, the JS object that has tracked shopper activity and triggered sign-up forms is _learnq.While most brands are able to accomplish all of their use cases for triggering onsite experiences with _learnq and the the setting available in<a>Klaviyos form builder,</a>there are some brands with development resources that want to go deeper.</p>
5 - <p>While most brands are able to accomplish all of their use cases for triggering onsite experiences with _learnq and the the setting available in<a>Klaviyos form builder,</a>there are some brands with development resources that want to go deeper.</p>
5 + <p>Where _learnq has fallen short for those brands is that it does not notify you when Klaviyo completes an action. So if you wanted to, for example, wait to show a form on your website until Klaviyo lets you know that we have identified a shopper, or wait to redirect a shopper until you know Klaviyo has updated their profile with their birthday or first name, you didnt have that flexibility. But through the use of callbacks or promises, brands can trigger onsite experiences based on notifications from Klaviyo APIs, making these more customized marketing strategies possible.</p>
6 - <p>Where _learnq has fallen short for those brands is that it does not notify you when Klaviyo completes an action. So if you wanted to, for example, wait to show a form on your website until Klaviyo lets you know that we have identified a shopper, or wait to redirect a shopper until you know Klaviyo has updated their profile with their birthday or first name, you didn’t have that flexibility. But through the use of callbacks or promises, brands can trigger onsite experiences based on notifications from Klaviyo APIs, making these more customized marketing strategies possible. </p>
 
7 <p><strong>The solution</strong></p>
6 <p><strong>The solution</strong></p>
8 <h2><strong>New JavaScript Object</strong></h2>
7 <h2><strong>New JavaScript Object</strong></h2>
9 <p>While _learnq has served brands that use Klaviyo well for a long time, we are excited to announce that a new JS object is now available that supports all the same functionality as its predecessor but also supports callbacks and promises. In addition, this new JS object also supports custom sign up form triggers, so you can launch a pop-up as a result of a shopper<a>clicking a button or a link on your website</a>.</p>
8 <p>While _learnq has served brands that use Klaviyo well for a long time, we are excited to announce that a new JS object is now available that supports all the same functionality as its predecessor but also supports callbacks and promises. In addition, this new JS object also supports custom sign up form triggers, so you can launch a pop-up as a result of a shopper<a>clicking a button or a link on your website</a>.</p>
10 <p>All new Klaviyo customers will get the new JS object automatically during onboarding, and brands that want to take advantage of this new functionality can update the Klaviyo code snippet on your site. If you don’t care about callbacks or promises, then no action is required. Klaviyo will continue to support the original _learnq JS object.</p>
9 <p>All new Klaviyo customers will get the new JS object automatically during onboarding, and brands that want to take advantage of this new functionality can update the Klaviyo code snippet on your site. If you don’t care about callbacks or promises, then no action is required. Klaviyo will continue to support the original _learnq JS object.</p>
11 <h3><strong>Getting started</strong></h3>
10 <h3><strong>Getting started</strong></h3>
12 <p>If you want to take advantage of this new functionality, and you’re ready to get started, replace the existing Klaviyo code on your website with the<a>new JS object</a>. You will then be able to utilize callbacks to trigger events - such as showing a pop-up or redirecting shoppers to a thank you page - when Klaviyo actions such as identifying or tracking site visitors have been completed.</p>
11 <p>If you want to take advantage of this new functionality, and you’re ready to get started, replace the existing Klaviyo code on your website with the<a>new JS object</a>. You will then be able to utilize callbacks to trigger events - such as showing a pop-up or redirecting shoppers to a thank you page - when Klaviyo actions such as identifying or tracking site visitors have been completed.</p>
13 <p>Check out<a>the guide</a>on how to update the Klaviyo JS object on your website.</p>
12 <p>Check out<a>the guide</a>on how to update the Klaviyo JS object on your website.</p>
14  
13