From a2f0e3c555ceddb00d5b48afbb12dde078edb882 Mon Sep 17 00:00:00 2001 From: Rajneesh Date: Mon, 9 Oct 2023 16:16:38 +0530 Subject: [PATCH 1/3] adding Salesloft tracking code in footer --- blocks/footer/footer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blocks/footer/footer.js b/blocks/footer/footer.js index 336979e60..730d7b6f0 100644 --- a/blocks/footer/footer.js +++ b/blocks/footer/footer.js @@ -226,3 +226,9 @@ export default async function decorate(block) { }, 3000); } } + +(function(i,s,o,g,r,a,m){i['SLScoutObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://scout-cdn.salesloft.com/sl.js','slscout'); + slscout(["init", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0IjoxMTA4OTF9.VTtiOYLfvqPpOmg9SD5Pl4uz7Zmn-achb0JFgYmfFs0"]); From 131c0ff56ec5c5123c9419a44c91c67307fbeb04 Mon Sep 17 00:00:00 2001 From: Rajneesh Date: Mon, 9 Oct 2023 16:33:47 +0530 Subject: [PATCH 2/3] added in delayed js --- blocks/footer/footer.js | 6 ------ scripts/delayed.js | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blocks/footer/footer.js b/blocks/footer/footer.js index 730d7b6f0..336979e60 100644 --- a/blocks/footer/footer.js +++ b/blocks/footer/footer.js @@ -226,9 +226,3 @@ export default async function decorate(block) { }, 3000); } } - -(function(i,s,o,g,r,a,m){i['SLScoutObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','https://scout-cdn.salesloft.com/sl.js','slscout'); - slscout(["init", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0IjoxMTA4OTF9.VTtiOYLfvqPpOmg9SD5Pl4uz7Zmn-achb0JFgYmfFs0"]); diff --git a/scripts/delayed.js b/scripts/delayed.js index ce37b9cfc..343aa1246 100644 --- a/scripts/delayed.js +++ b/scripts/delayed.js @@ -100,3 +100,9 @@ if (!isSidekickLibrary) { LoadDriftWidget(); } } + +(function(i,s,o,g,r,a,m){i['SLScoutObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://scout-cdn.salesloft.com/sl.js','slscout'); + slscout(["init", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0IjoxMTA4OTF9.VTtiOYLfvqPpOmg9SD5Pl4uz7Zmn-achb0JFgYmfFs0"]) \ No newline at end of file From 81cb5718eb6adcafe5bfc3f8c3578c4ae5f49b59 Mon Sep 17 00:00:00 2001 From: Rajneesh Date: Mon, 9 Oct 2023 16:40:24 +0530 Subject: [PATCH 3/3] add in function --- scripts/delayed.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/delayed.js b/scripts/delayed.js index 343aa1246..0ace2adb9 100644 --- a/scripts/delayed.js +++ b/scripts/delayed.js @@ -90,6 +90,14 @@ function loadGTM() { document.head.prepend(scriptTag); } +function laodSalessoft(){ + (function(i,s,o,g,r,a,m){i['SLScoutObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://scout-cdn.salesloft.com/sl.js','slscout'); + slscout(["init", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0IjoxMTA4OTF9.VTtiOYLfvqPpOmg9SD5Pl4uz7Zmn-achb0JFgYmfFs0"]) +} + if (!isSidekickLibrary) { sampleRUM('cwv'); loadUserData(); @@ -99,10 +107,9 @@ if (!isSidekickLibrary) { if (!window.location.hostname.includes('localhost') && !document.location.hostname.match('.hlx.page') && !document.location.hostname.match('www.moleculardevices.com.cn')) { LoadDriftWidget(); } + if (!window.location.hostname.includes('localhost') && !document.location.hostname.match('.hlx.page') && !document.location.hostname.match('www.moleculardevices.com.cn')) { + laodSalessoft(); + } + } -(function(i,s,o,g,r,a,m){i['SLScoutObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','https://scout-cdn.salesloft.com/sl.js','slscout'); - slscout(["init", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0IjoxMTA4OTF9.VTtiOYLfvqPpOmg9SD5Pl4uz7Zmn-achb0JFgYmfFs0"]) \ No newline at end of file