mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
* Rename `suppressGoogleAnalytics` to `suppressAnalytics` * Add Propensity script * Add LinkedIn Insight Tag script * Version the cookie to prevent adding unconsented tracking * Move tracking loaders to Typescript, insert them in foot_scripts.pug * Show the cookie-banner when tracking other than GA is set * Revert `oa` cookie versioning * Remove `async` from propensity script * Use shared tracking loader for Hotjar, LinkedIn, and Propensity * Reusable `insertScript` * Remove tracking-linkedin * Test the scripts by adding fake ids * Revert "Test the scripts by adding fake ids" This reverts commit 50759bb6b40fd2684d1b967d83dd71e8517c3de9. GitOrigin-RevId: 2a7b36bfc70ac1fc983f837dd4693a19a385cbc6
24 lines
579 B
TypeScript
24 lines
579 B
TypeScript
import getMeta from '@/utils/meta'
|
|
import {
|
|
createTrackingLoader,
|
|
insertScript,
|
|
} from '@/infrastructure/tracking-loader'
|
|
|
|
const { propensityId } = getMeta('ol-ExposedSettings')
|
|
|
|
if (propensityId) {
|
|
createTrackingLoader(() => loadPropensityScript(propensityId), 'Propensity')
|
|
}
|
|
|
|
const loadPropensityScript = (id: string) => {
|
|
insertScript({
|
|
src: 'https://cdn.propensity.com/propensity/propensity_analytics.js',
|
|
crossorigin: 'anonymous',
|
|
onload: () => {
|
|
if (typeof window.propensity !== 'undefined') {
|
|
window.propensity(id)
|
|
}
|
|
},
|
|
})
|
|
}
|