Main script
Place this script on all public pages of the site inside the <head> element.
Warning |
---|
Don't forget to replace the %YOUR_STORE_KEY% text with the current store key from your PersonaClick account. |
Code Block |
---|
language | js |
---|
theme | FadeToGrey |
---|
|
<script>
(function(){
window.personaclick=window.personaclick||function(){(window.personaclick.q=window.personaclick.q||[]).push(arguments)};
var c="//cdn.personaclick.com",v="/v3.js",s={link:[{href:c,rel:"dns-prefetch"},{href:c,rel:"preconnect"},{href:c+v,rel:"preload",as:"script"}],script:[{src:c+v,async:""}]};
Object.keys(s).forEach(function(c){s[c].forEach(function(d){var e=document.createElement(c),a;for(a in d)e.setAttribute(a,d[a]);document.head.appendChild(e)})});
})();
personaclick("init", "%YOUR_STORE_KEY%");
</script> |
Additional Features
The initialization method has additional features - callback functions for success and error states