Adobe Experience Platform · updated
Adobe Web SDK: the configure and sendEvent commands
The Web SDK needs three things on a page: a small base code with the library loader, one configure command, and at least one sendEvent command. configure must run first on every page load and needs a datastreamId and an orgId. sendEvent sends the data, in an xdm object that matches your schema, and its response carries personalised content. A payload can be at most 64 KB.
In plain words
The Web SDK is Adobe's single script for sending website data to Adobe. You tell it once which Adobe account and which datastream to use. After that, each thing you want to record, a page view, a click, a purchase, is one sendEvent call. The same call can bring back Target or Journey Optimizer content for the page.
Installing without a tag manager
Adobe hosts the library at https://cdn1.adoberesources.net/alloy/<VERSION>/alloy.min.js (and alloy.js for the full file). You can reference it or host a copy yourself. The base code queues commands until the library has loaded. Adobe says to place both as high as possible in the head, before any script that might call the Web SDK. The release notes list 2.37.1, dated 4 November 2026, as the newest version.
configure: the settings most sites use
| Property | What it does | Default |
|---|---|---|
| datastreamId | Which datastream receives the data. Required. Without it Adobe says the data is permanently lost. | None |
| orgId | Your organisation ID: a 24-character alphanumeric string ending in @AdobeOrg. Required. | None |
| edgeDomain | The domain data is sent to. Adobe considers an organisation-specific value a best practice. It does not change where cookies are set. | edge.adobedc.net |
| defaultConsent | What to do before setConsent is called: in, out or pending. Case sensitive. | in |
| debugEnabled | Writes debug messages to the console. Not recommended on production pages. | false |
| clickCollectionEnabled | Collects link clicks automatically into xdm.web.webInteraction. | true |
| context | Which automatic data to collect: web, device, environment, placeContext and two optional keywords. | All except highEntropyUserAgentHints and oneTimeAnalyticsReferrer |
| idMigrationEnabled | Reads the ECID from the older AMCV cookie so visitors are not counted as new. | true |
| targetMigrationEnabled | Reads and writes the at.js mbox cookies while some pages still use at.js. | false |
| prehidingStyle | A CSS rule that hides content until personalisation renders, for synchronous loading. | Not set |
sendEvent: the options
| Option | What it does |
|---|---|
| xdm | The data payload. Its hierarchy must match the schema of the configured dataset. |
| type | The event type; it fills xdm.eventType and takes priority over a value set inside xdm. |
| data | Data that does not match an XDM schema. It must be used by a service on the datastream or mapped with Data Prep, or it is permanently lost. |
| renderDecisions | Set to true to render personalised content automatically. Defaults to false. |
| personalization.decisionScopes | Names of the scopes to request, such as a Target mbox name. |
| documentUnloading | Uses the browser's sendBeacon so a request survives leaving the page. Not compatible with renderDecisions. |
| edgeConfigOverrides | Datastream overrides for this one call. |
The response object has propositions (personalised content, with renderAttempted set to true on those rendered automatically), inferences and destinations.
What the Web SDK fills in for you
With the default context, the SDK adds the page URL (xdm.web.webPageDetails.URL), the referrer, screen size, browser details, local time and a timestamp to every event. With click collection on, link clicks are sent with xdm.web.webInteraction.name, type and URL; the type is download, exit or other. Country and city are not collected by the SDK: the Edge Network adds them from the IP address when Geo Lookup is on in the datastream.
A common mistake Adobe describes: an early sendEvent fetches personalisation without renderDecisions, and a later one sets renderDecisions to true without any scopes, so nothing is rendered. Set renderDecisions on the first call, or name the scopes on the later one.
Base code and library loader, as on Adobe's install page (replace <VERSION>)
<!-- Base code -->
<script>
!function(n,o){o.forEach(function(o){n[o]||((n.__alloyNS=n.__alloyNS||
[]).push(o),n[o]=function(){var u=arguments;return new Promise(
function(i,l){n.setTimeout(function(){n[o].q.push([i,l,u])})})},n[o].q=[])})}
(window,["alloy"]);
</script>
<!-- Library loader -->
<script src="https://cdn1.adoberesources.net/alloy/<VERSION>/alloy.min.js" async></script>The smallest configuration (placeholders, not real IDs)
alloy("configure", {
datastreamId: "YOUR_DATASTREAM_ID",
orgId: "YOUR_ORG_ID@AdobeOrg"
});A page view
alloy("sendEvent", {
renderDecisions: true,
type: "web.webpagedetails.pageViews",
xdm: {
web: {
webPageDetails: {
name: "Home",
pageViews: { value: 1 }
}
}
}
});How to add it to a page
- Create a datastream and an XDM schema with the field groups your events need.
- Add the base code and the library loader high in the head.
- Call configure once per page load with your datastreamId and orgId, before any other command.
- Call sendEvent for the page view, with an xdm object that matches the schema.
- Add further sendEvent calls for the actions you measure, each with its own type.
- Check the request in the browser's network panel and, with debugEnabled on a test page, the console messages.
Related tools and pages on this site
- Web SDK snippet builder (free, runs in your browser)
- Adobe tag, Web SDK and consent scan (reads a live site's page code)
- Adobe Target answers
Questions
Where do I find the organisation ID?
Adobe's page says to press Ctrl + I anywhere in Adobe's interface; a User Data Debugger window shows the current org ID. It is always 24 alphanumeric characters followed by @AdobeOrg.
Is edgeConfigId still valid?
Adobe says Web SDK versions 2.20.0 or earlier use edgeConfigId instead of datastreamId. Adobe's Target migration tutorial still shows edgeConfigId in its examples.
How big can an event be?
Adobe's sendEvent page gives a maximum payload of 64 KB.
Should the library load asynchronously?
Adobe's install code uses async. It says removing async blocks HTML parsing while the library loads, which is typically discouraged but can make sense for some sites.
How do I check what a live site has?
Our tag scan reads public pages and reports alloy.js and its version, a defaultConsent setting if present, and whether older Adobe libraries load on the same pages.
Sources
- Adobe: Install the Web SDK using the JavaScript library (base code and library loader) (checked 13 Nov 2026)
- Adobe: Web SDK release notes (checked 13 Nov 2026)
- Adobe: configure (Web SDK command) (checked 13 Nov 2026)
- Adobe: datastreamId (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: orgId (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: edgeDomain (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: defaultConsent (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: debugEnabled (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: clickCollectionEnabled (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: context (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: idMigrationEnabled (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: targetMigrationEnabled (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: sendEvent (Web SDK command) (checked 13 Nov 2026)
- Adobe: xdm (Web SDK sendEvent command) (checked 13 Nov 2026)
- Adobe: eventType (Web SDK sendEvent command) (checked 13 Nov 2026)
- Adobe: data (Web SDK sendEvent command) (checked 13 Nov 2026)
- Adobe: renderDecisions (Web SDK sendEvent command) (checked 13 Nov 2026)
- Adobe: documentUnloading (Web SDK sendEvent command) (checked 13 Nov 2026)
- Adobe: Manage flicker (Web SDK) (checked 13 Nov 2026)
Facts about Adobe's products on this page are from the linked Adobe pages, read on the date shown beside each. Explanations, steps and examples are ours unless marked as Adobe's. If Adobe's page and this one differ, Adobe's page is right.
Surge Migrate is not affiliated with Adobe and claims no Adobe partner status. Adobe product names are trademarks of Adobe.