Skip to content

Commit 92e76a0

Browse files
authored
Smartloook integration init (#515)
* Smartloook integration init * Unify variables
1 parent ee37a2d commit 92e76a0

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"vuepress-plugin-fulltext-search": "^2.2.1"
2424
},
2525
"dependencies": {
26-
"@gtm-support/vue2-gtm": "1.0.0"
26+
"@gtm-support/vue2-gtm": "1.0.0",
27+
"smartlook-client": "^10.0.0"
2728
}
2829
}

src/.vuepress/components/CookieConsentView.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<script lang="ts">
1919
import Vue from "vue";
20+
import Smartlook from "smartlook-client";
2021
2122
import CookieConsentBanner from "./cookie-consent/components/CookieConsentBanner.vue";
2223
import CookieConsentPreferences from "./cookie-consent/components/CookieConsentPreferences.vue";
@@ -83,6 +84,12 @@ export default Vue.extend({
8384
immediate: true,
8485
handler: function (value) {
8586
this.$gtm && this.$gtm.enable(value);
87+
const smartlookKey = __SMARTLOOK_KEY__
88+
if (value && smartlookKey && !Smartlook.initialized()) {
89+
Smartlook.init(smartlookKey, {
90+
region: 'eu'
91+
})
92+
}
8693
},
8794
},
8895
},

src/.vuepress/config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,9 @@ module.exports = {
104104

105105
globalUIComponents: [
106106
'CookieConsentView'
107-
]
107+
],
108+
109+
define: {
110+
__SMARTLOOK_KEY__: 'a42250fed50d7af2a9630117644ec5ac4b9c419f'
111+
}
108112
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7331,6 +7331,11 @@ slash@^2.0.0:
73317331
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
73327332
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
73337333

7334+
smartlook-client@^10.0.0:
7335+
version "10.0.0"
7336+
resolved "https://registry.yarnpkg.com/smartlook-client/-/smartlook-client-10.0.0.tgz#8c322bfa5866f5d9c1553c22aa98382367f798bd"
7337+
integrity sha512-KAyy+MXxgqfQJOqsnJhlFiBP29g7rE50hmdoSB3YYq15Dl9y8WEdh1OhdUAYWnENkyDHu3v5lE39O6VuhQMgrA==
7338+
73347339
smoothscroll-polyfill@^0.4.3:
73357340
version "0.4.4"
73367341
resolved "https://registry.yarnpkg.com/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz#3a259131dc6930e6ca80003e1cb03b603b69abf8"

0 commit comments

Comments
 (0)