Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Created August 1, 2023 13:01
Show Gist options
  • Save xlplugins/25cd4aedaebcef6d76b82e8186dd2abd to your computer and use it in GitHub Desktop.
Save xlplugins/25cd4aedaebcef6d76b82e8186dd2abd to your computer and use it in GitHub Desktop.
converios track on funnelkit cart open
add_action( 'wp_footer', function () {
?>
<script>
window.addEventListener('load', function () {
jQuery('body').on('fkcart_open', function () {
(function (a, b) {
a = "https://log.superceramiccoating.com/conversion.js?cid={clickid}&et=add_to_cart";
var c = b.createElement("script"), d = b.scripts[0];
if (b = b.cookie.match(/(^| )vl-cid=([^;]+)/)) if (-1 < a.indexOf("cid=")) a = a.replace(/cid=.*?(&|$)/, "cid=" + b.pop() + "&"); else {
var e = -1 < a.indexOf("?") ? "&" : "?";
a += e + "cid=" + b.pop()
}
c.src = a;
d.parentNode.insertBefore(c, d)
})(window, document);
});
})
</script>
<?php
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment