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

PropertyWhat it doesDefault
datastreamIdWhich datastream receives the data. Required. Without it Adobe says the data is permanently lost.None
orgIdYour organisation ID: a 24-character alphanumeric string ending in @AdobeOrg. Required.None
edgeDomainThe 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
defaultConsentWhat to do before setConsent is called: in, out or pending. Case sensitive.in
debugEnabledWrites debug messages to the console. Not recommended on production pages.false
clickCollectionEnabledCollects link clicks automatically into xdm.web.webInteraction.true
contextWhich automatic data to collect: web, device, environment, placeContext and two optional keywords.All except highEntropyUserAgentHints and oneTimeAnalyticsReferrer
idMigrationEnabledReads the ECID from the older AMCV cookie so visitors are not counted as new.true
targetMigrationEnabledReads and writes the at.js mbox cookies while some pages still use at.js.false
prehidingStyleA CSS rule that hides content until personalisation renders, for synchronous loading.Not set

sendEvent: the options

OptionWhat it does
xdmThe data payload. Its hierarchy must match the schema of the configured dataset.
typeThe event type; it fills xdm.eventType and takes priority over a value set inside xdm.
dataData 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.
renderDecisionsSet to true to render personalised content automatically. Defaults to false.
personalization.decisionScopesNames of the scopes to request, such as a Target mbox name.
documentUnloadingUses the browser's sendBeacon so a request survives leaving the page. Not compatible with renderDecisions.
edgeConfigOverridesDatastream 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

  1. Create a datastream and an XDM schema with the field groups your events need.
  2. Add the base code and the library loader high in the head.
  3. Call configure once per page load with your datastreamId and orgId, before any other command.
  4. Call sendEvent for the page view, with an xdm object that matches the schema.
  5. Add further sendEvent calls for the actions you measure, each with its own type.
  6. 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

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

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.

Surge Migrate

Moving the website itself

This page answers one Adobe Experience Platform question. Surge Migrate moves a website from any CMS to any CMS. Converted automatically. Checked before you install.

  1. 1

    Scan

    Names the system behind your site, counts pages and templates, lists the blocks to build and the work no tool does, and gives an effort range with its working.

    Scan a site →
  2. 2

    Convert

    Each page becomes an Edge Delivery document, an AEM Core Component page and import files for 7 other systems. 10 pages free; 500 or 2,000 pages in one paid run.

    Convert your pages →
  3. 3

    Verify

    A download is offered only when its own format check passes. The report lists every field not found and every component kept as plain content. Compare old and new pages side by side.

    Parity check →
  4. 4

    Install

    You import with the target system's own tool, on your own environment. Each download's README gives the command. Your system changes only when you run it.

    How each import was tested →