Configuration for the Web SDK is done with the configure
command. Configuring the Web SDK is a vital and required step that must happen whenever the library or tag extension is used.
Follow the steps below to configure the Web SDK through the tag extension.
These configuration settings are set whenever you use the extension to send data to Adobe.
Run the configure
command. This command is required before you can call any other Web SDK commands, such as sendEvent
.
The datastreamId
and orgId
properties are required. All other properties are optional, depending on your organization’s implementation requirements.
See the table of contents of this user guide for detailed information about each of the supported commands.
alloy("configure", {
datastreamId: "ebebf826-a01f-4458-8cec-ef61de241c93",
orgId: "ADB3LETTERSANDNUMBERS@AdobeOrg",
clickCollectionEnabled: true,
clickCollection: {
internalLinkEnabled: true,
downloadLinkEnabled: true,
externalLinkEnabled: true,
eventGroupingEnabled: true,
sessionStorageEnabled: true
},
context: ["web", "device", "environment", "placeContext", "highEntropyUserAgentHints"],
debugEnabled: true,
defaultConsent: "pending",
downloadLinkQualifier: "\.(exe|zip|wav|mp3|mov|mpg|avi|wmv|pdf|doc|docx|xls|xlsx|ppt|pptx)$",
edgeBasePath: "ee",
edgeConfigOverrides: { "datastreamId": "0dada9f4-fa94-4c9c-8aaf-fdbac6c56287" },
edgeDomain: "data.example.com",
idMigrationEnabled: false,
onBeforeEventSend: function(content) {
if(content.xdm.web?.webReferrer) delete content.xdm.web.webReferrer.URL;
},
onBeforeLinkClickSend: function(content) {
content.xdm.web.webPageDetails.URL = "https://example.com/current.html";
},
prehidingStyle: "#container { opacity: 0 !important }",
targetMigrationEnabled: true,
thirdPartyCookiesEnabled: false
});