Skip to content

Commit

Permalink
test showing ketch preferences on load
Browse files Browse the repository at this point in the history
  • Loading branch information
colegoldsmith committed Jan 16, 2025
1 parent 0cf2a0f commit 6a7cfaf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/partials/head-scripts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ analytics.page();
{{!-- {{#with site.keys.ketchSmartTagUrl}} --}}
<script>!function(){window.semaphore=window.semaphore||[],window.ketch=function(){window.semaphore.push(arguments)};var e=document.createElement("script");e.type="text/javascript",e.src="https://global.ketchcdn.com/web/v3/config/datastax/website_smart_tag/boot.js",e.defer=e.async=!0,document.getElementsByTagName("head")[0].appendChild(e)}();</script>
<script>
if (window.ketch) {
if (ketch) {
ketch('showPreferences');
function saveConsent(consent) {
window.ketchConsent = consent;
};
window.ketch("on", "consent", (consent) => {
ketch("on", "consent", (consent) => {
saveConsent(consent);
// Only load Segment analytics if the user has consented to analytics
if (consent?.purposes?.analytics && window.analytics) {
window.analytics.load("{{../site.keys.segment}}");
}
});
window.ketch("on", "userConsentUpdated", saveConsent);
window.ketch("on", "regionInfo", regionInfo => {
ketch("on", "userConsentUpdated", saveConsent);
ketch("on", "regionInfo", regionInfo => {
var customTextRegions = ["US-CA"];
if (customTextRegions.includes(regionInfo)) {
var preferenceCenterLinkElement = document.getElementById("preferenceCenterLink");
Expand Down

0 comments on commit 6a7cfaf

Please sign in to comment.