Skip to content

Commit a3937f2

Browse files
committed
consent(usercentrics): set ruleset-id
1 parent c080a71 commit a3937f2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

gatsby-config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,14 @@ const plugins = [
110110

111111
// keep usercentrics plugin before plausible
112112
let usercentricsSettingsId = process.env.GATSBY_USERCENTRICS_SETTINGS_ID
113-
if (usercentricsSettingsId) {
113+
let usercentricsRulesetId = process.env.GATSBY_USERCENTRICS_RULESET_ID
114+
if (usercentricsSettingsId || usercentricsRulesetId) {
114115
plugins.push({
115116
resolve: 'gatsby-plugin-usercentrics',
116-
options: { settingsId: usercentricsSettingsId }
117+
options: {
118+
settingsId: usercentricsSettingsId,
119+
rulesetId: usercentricsRulesetId
120+
}
117121
})
118122
}
119123

plugins/gatsby-plugin-usercentrics/gatsby-ssr.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const onRenderBody = ({ setHeadComponents }, { settingsId }) =>
1+
export const onRenderBody = (
2+
{ setHeadComponents },
3+
{ settingsId, rulesetId }
4+
) =>
25
setHeadComponents([
36
<script
47
key="usercentrics-autoblocker"
@@ -9,6 +12,7 @@ export const onRenderBody = ({ setHeadComponents }, { settingsId }) =>
912
id="usercentrics-cmp"
1013
src="https://web.cmp.usercentrics.eu/ui/loader.js"
1114
data-settings-id={settingsId}
15+
data-ruleset-id={rulesetId}
1216
async
1317
/>,
1418
<script

0 commit comments

Comments
 (0)