use mattermost siteURL to determine rudder cookie domain (#2294)
This commit is contained in:
parent
b92a3a9786
commit
dfa5d54b16
1 changed files with 8 additions and 1 deletions
|
@ -172,7 +172,14 @@ export default class Plugin {
|
|||
}
|
||||
|
||||
if (rudderKey !== '') {
|
||||
rudderAnalytics.load(rudderKey, rudderUrl)
|
||||
const rudderCfg = {} as {setCookieDomain: string}
|
||||
if (siteURL && siteURL !== '') {
|
||||
try {
|
||||
rudderCfg.setCookieDomain = new URL(siteURL).hostname
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (_) {}
|
||||
}
|
||||
rudderAnalytics.load(rudderKey, rudderUrl, rudderCfg)
|
||||
|
||||
rudderAnalytics.identify(config?.telemetryid, {}, TELEMETRY_OPTIONS)
|
||||
|
||||
|
|
Loading…
Reference in a new issue