Skip to main content

Core

The options listed below pertain to core features and functionality of the web SDK. See an example config here.

Available Options

OptionDescriptionDefaultType
additionalPublicAppIdsWhen included, all analytics events will be sent to each of the public app IDs in the list (guide events are only sent to the primary public app ID). This will only function if there are no additionalPublicAppIds set on the configuration included in the downloaded web SDK. Alias: additionalApiKeys[]Array.<string>
annotateUrlA function that returns either an array of strings or an object to decorate the url for events. Deprecated: new usages to edit the url for events should use the location api.undefinedfunction
autoFrameInstallIf set to true, the web SDK will try to install and initialize in all same-origin frames on the page. Read more about frame support.falseboolean
contentHostAn alternate url to load guide content from. This will be used to replace the standard google storage url for your subscription. Usually used for CNAME setups.undefinedstring
cookieDomainA unique domain to append to cookies that the web SDK stores. If this is set, the web SDK will not use local storage but will store all information as cookies using this domain. If not set, the browser will use the current domain when setting cookies. Note: The domain must match the domain of the JavaScript origin. Setting cookies to foreign domains will be silently ignored. Read more on MDN.undefinedstring
crossAppGuideStorageSuffixIf set, the web SDK will use this as the suffix when writing last step advanced key into the visitors cookie. This supports cross app guides by having a shared accessible location for different apps on the same effective level domain.&#x27;&#x27;string
dataHostAn alternate url to use when transmitting event data. Usually used for CNAME setups.undefinedstring
disableCookiesAlthough the name refers to cookies, if set to true the web SDK will not persist any data in local storage or cookies and will rely only on memory.falseboolean
disableFeedbackIf Feedback is setup for your subscription, this option can be used to selectively disable Feedback.falseboolean
disablePendoIf set to true the web SDK will cancel out of initialization. This can be useful to disable the web SDK with minimal code changes.falseboolean
disablePersistenceBy default, the web SDK will store the most recently used visitor and account ids as well as historical metadata. These stored values will be used if the web SDK is initialized in the future without them. Setting this to true will mean the web SDK will not store these values but will only use what is provided or fall back to anonymous ids.falseboolean
enableCrossOriginIsolationIf true, the web SDK will launch a version of the Designer that is compatible with the Cross-Origin-Embedder-Policy: require-corp header.falseboolean
eventPropertyTimeoutMaximum time in milliseconds that event property collection can take before it is considered a failure. If collection fails more than 3 times consecutively, event property collection will be disabled completely.50number
forceAnonymousHaving identity persisted by default makes it so that a transition from using identified visitor ids to using anonymous visitor ids is challenging. Anyone that used your application with an identified visitor id would have that value persisted to storage and whenever the web SDK is initialized for them, that value would be read from storage treating them as the same identified visitor. When set true, this config option will only use persisted identity values if they are an anonymous id. It is meant to be used to smoothly make this transition to using anonymous ids while still retaining the benefit of consistent anonymous ids for visitors. This option will be ignored if you provide an identified visitorId to the initialize call.falseboolean
forceLeaderIf set to true, the web SDK will prioritize this frame to use as the leader frame that will coordinate the display of guides and the resource center. The leader frame is usually the "top" frame if the SDK is initialized there and this option is meant to be used when that condition is not met or the leader should be some other specific frame. Sitewide guides and the resource center will always attempt to be shown in the leader frame first.falseboolean
frameIdentitySyncBy default, the identity of a visitor in various iframes on a page are independent from each other. Setting this to true will instead have the web SDK make sure all frames use the exact same visitor and account information. Read more about frame support.falseboolean
frameIdentityTopDownOnlyApps with frames can choose to share Identity details between the frames. By default, these will only share from the top frame down to child frames but this can be configured to allow for child frames to also share the identity upwards as well.trueboolean
ignoreHashRoutingIf set to true, the web SDK will strip url fragments from the url used for events (everything after a # symbol). Deprecated: new usages to edit the url for events should use the location api.falseboolean
initializeImmediatelyBy default, the web SDK will wait until the document.readyState is set to "complete". Setting this to true will allow the web SDK to initialize while the document is still loading.falseboolean
localStorageOnlyIf set to true, the web SDK will only persist data using local storage and memory.falseboolean
location.pushStateIf set to false, the web SDK will not use the History.pushState api to detect changes to the browser's URL. Instead a poll will be used. This can be necessary to disable for some SFDC applications.trueboolean
observeShadowRootsUse this setting when using preferMutationObserver with an application that has Shadow DOM elements. On page load, the web SDK will run a full document scan for shadow roots and attach a MutationObserver to all results. This setting also allows the web SDK to run CSS selectors in all shadow roots, so CSS selectors can be written without specifying the full path through all shadow roots with the ::shadow pseudo-class.falseboolean
preferBroadcastChannelBy default, if there are multiple frames on the page that have the web SDK installed, they will communicate using window.postMessage. If set to true the web SDK will instead use the browser's Broadcast Channel API to communicate. This will only work when all frames use the same domain.falseboolean
preferMutationObserverBy default, the web SDK will scan the page every 500ms to determine if any new badges or guides are eligible. To improve idle performance, this can be set to true and then the web SDK will instead use a mutation observer and only check eligibility if the page content has changed.falseboolean
preventUnloadListenerBy default, the web SDK adds an unload event listener to the page to make sure it sends events upon navigation. If set to true, the web SDK will instead use the visibilitychange event listener and send events when the visibility is changing to "hidden".falseboolean
publicAppIdA primary public app ID to send data to from the web SDK. This will only function if there is no publicAppId set on the configuration included in the downloaded web SDK. Alias: apiKeyundefinedstring
queryStringWhitelistAn array of strings or a function that returns an array of strings. The web SDK will then strip any query string parameters from the url that are not found in the provided array. Deprecated: new usages to edit the url for events should use the location api.undefinedArray.<string>
sanitizeUrlA function that takes the current url and should return a new url to use instead. This can be used to remove sensitive data or alter it in any way. Deprecated: new usages to edit the url for events should use the location api.undefinedfunction
selfHostedWebSDKUrlMeant to be used with autoFrameInstall. If set, the web SDK will use this as the url to download itself from in child frames. Read more about frame support. Alias: selfHostedAgentUrlundefinedstring
sendEventsWithPostOnlyIf this option is set to true, event data will only be transmitted using requests of type POST instead of first trying to use GET requests. This can result in fewer requests being sent each time that event data is transmitted.falseboolean