Skip to content

Commit

Permalink
Added support for PostHog loaded config (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 authored and saikumarrs committed Jan 21, 2022
1 parent f6d9b6b commit 3c2bc4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integrations/Posthog/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class Posthog {
}, e.__SV = 1)
}(document, window.posthog || []);

const { POSTHOG } = this.analytics.loadOnlyIntegrations;

const configObject = {
api_host: this.yourInstance,
autocapture: this.autocapture,
Expand All @@ -68,6 +70,10 @@ class Posthog {
property_blacklist: this.propertyBlackList,
disable_cookie: this.disableCookie,
};

if (POSTHOG && POSTHOG.loaded) {
configObject.loaded = POSTHOG.loaded;
}
if (this.xhrHeaders && Object.keys(this.xhrHeaders).length > 0) {
configObject.xhr_headers = this.xhrHeaders;
}
Expand Down

0 comments on commit 3c2bc4a

Please sign in to comment.