-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BG-1007: Fix errors caused by third party scripts (#2608)
error must've been caused by trying to hide intercom launcher ## Explanation of the solution * since intercom launcher is fixed in bottom corner, attach observer to `<Footer/>` that will trigger hiding of launcher * use `.intercom` class to hide intercom ### others - move third party scripts to own file ### future - we could use [partytown](https://partytown.builder.io/) so that our scripts don't all load along side our web-app. I tried using it but dev server becomes slower. created ticket to use this tech once its stable / or we upgraded our tooling ## Instructions on making this work - run `yarn` or `yarn install` to install npm dependencies - run `yarn run test --watchAll` to verify all tests still pass - (optional) run `yarn run build` to verify the build passes - run `yarn start` to start the webapp - ## UI changes for review When major UI changes are introduced with a PR, please include links to URLS to compare or screenshots demonstrating the difference and notify on design changes
- Loading branch information
Showing
9 changed files
with
136 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag() { | ||
dataLayer.push(arguments); | ||
} | ||
gtag("config", "G-Z2YP33XHHD"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(function (h, o, t, j, a, r) { | ||
h.hj = | ||
h.hj || | ||
function () { | ||
(h.hj.q = h.hj.q || []).push(arguments); | ||
}; | ||
h._hjSettings = { hjid: 3374479, hjsv: 6 }; | ||
a = o.getElementsByTagName("head")[0]; | ||
r = o.createElement("script"); | ||
r.async = 1; | ||
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv; | ||
a.appendChild(r); | ||
})(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv="); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//Set your APP_ID | ||
var APP_ID = "fh3v40sb"; | ||
|
||
window.intercomSettings = { | ||
app_id: APP_ID, | ||
}; | ||
(function () { | ||
var w = window; | ||
var ic = w.Intercom; | ||
if (typeof ic === "function") { | ||
ic("reattach_activator"); | ||
ic("update", w.intercomSettings); | ||
} else { | ||
var d = document; | ||
var i = function () { | ||
i.c(arguments); | ||
}; | ||
i.q = []; | ||
i.c = function (args) { | ||
i.q.push(args); | ||
}; | ||
w.Intercom = i; | ||
var l = function () { | ||
var s = d.createElement("script"); | ||
s.type = "text/javascript"; | ||
s.async = true; | ||
s.src = "https://widget.intercom.io/widget/" + APP_ID; | ||
var x = d.getElementsByTagName("script")[0]; | ||
x.parentNode.insertBefore(s, x); | ||
}; | ||
if (document.readyState === "complete") { | ||
l(); | ||
} else if (w.attachEvent) { | ||
w.attachEvent("onload", l); | ||
} else { | ||
w.addEventListener("load", l, false); | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
_linkedin_partner_id = "4969890"; | ||
window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; | ||
window._linkedin_data_partner_ids.push(_linkedin_partner_id); | ||
|
||
(function (l) { | ||
if (!l) { | ||
window.lintrk = function (a, b) { | ||
window.lintrk.q.push([a, b]); | ||
}; | ||
window.lintrk.q = []; | ||
} | ||
var s = document.getElementsByTagName("script")[0]; | ||
var b = document.createElement("script"); | ||
b.type = "text/javascript"; | ||
b.async = true; | ||
b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; | ||
s.parentNode.insertBefore(b, s); | ||
})(window.lintrk); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
!(function (f, b, e, v, n, t, s) { | ||
if (f.fbq) return; | ||
n = f.fbq = function () { | ||
n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments); | ||
}; | ||
if (!f._fbq) f._fbq = n; | ||
n.push = n; | ||
n.loaded = !0; | ||
n.version = "2.0"; | ||
n.queue = []; | ||
t = b.createElement(e); | ||
t.async = !0; | ||
t.src = v; | ||
s = b.getElementsByTagName(e)[0]; | ||
s.parentNode.insertBefore(t, s); | ||
})( | ||
window, | ||
document, | ||
"script", | ||
"https://connect.facebook.net/en_US/fbevents.js" | ||
); | ||
fbq("init", "717089233225873"); | ||
fbq("track", "PageView"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
!(function (e, t, n, s, u, a) { | ||
e.twq || | ||
((s = e.twq = | ||
function () { | ||
s.exe ? s.exe.apply(s, arguments) : s.queue.push(arguments); | ||
}), | ||
(s.version = "1.1"), | ||
(s.queue = []), | ||
(u = t.createElement(n)), | ||
(u.async = !0), | ||
(u.src = "https://static.ads-twitter.com/uwt.js"), | ||
(a = t.getElementsByTagName(n)[0]), | ||
a.parentNode.insertBefore(u, a)); | ||
})(window, document, "script"); | ||
twq("config", "oehvo"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters