Skip to content

Commit

Permalink
Smartloook integration init (#515)
Browse files Browse the repository at this point in the history
* Smartloook integration init

* Unify variables
  • Loading branch information
MarcelGeo authored Oct 14, 2024
1 parent ee37a2d commit 92e76a0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"vuepress-plugin-fulltext-search": "^2.2.1"
},
"dependencies": {
"@gtm-support/vue2-gtm": "1.0.0"
"@gtm-support/vue2-gtm": "1.0.0",
"smartlook-client": "^10.0.0"
}
}
7 changes: 7 additions & 0 deletions src/.vuepress/components/CookieConsentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<script lang="ts">
import Vue from "vue";
import Smartlook from "smartlook-client";
import CookieConsentBanner from "./cookie-consent/components/CookieConsentBanner.vue";
import CookieConsentPreferences from "./cookie-consent/components/CookieConsentPreferences.vue";
Expand Down Expand Up @@ -83,6 +84,12 @@ export default Vue.extend({
immediate: true,
handler: function (value) {
this.$gtm && this.$gtm.enable(value);
const smartlookKey = __SMARTLOOK_KEY__
if (value && smartlookKey && !Smartlook.initialized()) {
Smartlook.init(smartlookKey, {
region: 'eu'
})
}
},
},
},
Expand Down
6 changes: 5 additions & 1 deletion src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,9 @@ module.exports = {

globalUIComponents: [
'CookieConsentView'
]
],

define: {
__SMARTLOOK_KEY__: 'a42250fed50d7af2a9630117644ec5ac4b9c419f'
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7331,6 +7331,11 @@ slash@^2.0.0:
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==

smartlook-client@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/smartlook-client/-/smartlook-client-10.0.0.tgz#8c322bfa5866f5d9c1553c22aa98382367f798bd"
integrity sha512-KAyy+MXxgqfQJOqsnJhlFiBP29g7rE50hmdoSB3YYq15Dl9y8WEdh1OhdUAYWnENkyDHu3v5lE39O6VuhQMgrA==

smoothscroll-polyfill@^0.4.3:
version "0.4.4"
resolved "https://registry.yarnpkg.com/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz#3a259131dc6930e6ca80003e1cb03b603b69abf8"
Expand Down

0 comments on commit 92e76a0

Please sign in to comment.