var a =document.getElementsByTagName('script')[0];a.parentNode.insertBefore(b, a);
})();
</script>
This does a couple of really antiquated things.
It uses script tags...
It attaches the Klaviyo Analytics file to the DOM
It allows you to identify a use based on an email address
What it doesn't do is get that email address from the customer.
What I'm currently working with is a monstrosity that I created here this is my existing Klaviyo file, there's a couple of really antiquated things here as well.
It uses AMD (Built for RequireJs, now using webpack)
It selects individual forms, which are the heart of any Klaviyo event and does the same repetitive selecting every time I want to create a Klaviyo form, I wized up toward the end, but it's still not good enough!