Skip to content

Commit 8324e76

Browse files
committed
Modify consent code for cookie banner
1 parent 1285da9 commit 8324e76

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.storybook/manager-head.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<script src="https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js"></script>
22
<script src="https://az725175.vo.msecnd.net/scripts/jsll-4.js" type="text/javascript"></script>
33
<script type="text/javascript">
4-
function onConsentChanged(categoryPreferences) {
5-
console.log('onConsentChanged', categoryPreferences);
6-
}
7-
84
WcpConsent.init(
95
'en-US',
106
'cookie-banner',
@@ -18,15 +14,20 @@
1814
onConsentChanged
1915
);
2016

21-
var config = {
22-
autoCapture: {
23-
lineage: true
24-
},
25-
coreData: {
26-
appId: 'JS:GraphToolkit'
17+
function onConsentChanged(consentCategories) {
18+
if (siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)) {
19+
// add analytics
20+
var config = {
21+
autoCapture: {
22+
lineage: true
23+
},
24+
coreData: {
25+
appId: 'JS:GraphToolkit'
26+
}
27+
};
28+
awa.init(config);
2729
}
28-
};
29-
awa.init(config);
30+
}
3031
</script>
3132
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
3233
<div id="cookie-banner"></div>

0 commit comments

Comments
 (0)