Created
January 29, 2025 19:38
-
-
Save danielpaul/47d0c38f08d8b8ae75f3cd8252599586 to your computer and use it in GitHub Desktop.
CookieChimp JS on SPA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script is:inline> | |
function runCookieChimp() { | |
var script = document.createElement("script"); | |
script.src = "http://localhost:3000/widget/K8ktWD.js"; | |
script.id = "cookiechimp-js"; | |
document.head.appendChild(script); | |
} | |
// for Astro JS. | |
// listen for other events for different frameworks. | |
document.addEventListener("astro:page-load", runCookieChimp); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment