From 78ed15175e26a0f37887426052cf165cc5a46f49 Mon Sep 17 00:00:00 2001 From: Alexandre BRU Date: Tue, 10 May 2022 15:55:15 +0200 Subject: [PATCH] add Klaviyo service --- tarteaucitron.services.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 1ab1225..76e04a3 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -5326,3 +5326,20 @@ tarteaucitron.services.tiktok = { tarteaucitron.addScript('https://analytics.tiktok.com/i18n/pixel/sdk.js?sdkid=' + tarteaucitron.user.tiktokId); } }; + +// Klaviyo +tarteaucitron.services.klaviyo = { + "key": "klaviyo", + "type": "ads", + "name": "Klaviyo", + "uri": "https://help.klaviyo.com/hc/en-us/articles/360034666712-About-Cookies-in-Klaviyo", + "needConsent": true, + "cookies": ['__kla_id'], + "js": function () { + "use strict"; + if (tarteaucitron.user.klaviyoCompanyId === undefined || klCustomer === undefined) { + return; + } + tarteaucitron.addScript('//static.klaviyo.com/onsite/js/klaviyo.js?company_id=' + tarteaucitron.user.klaviyoCompanyId); + } +}; \ No newline at end of file