Free tool · no sign-up · runs locally

Web SDK snippet builder

Choose your settings and the event you want to send. You get the page code for the Adobe Experience Platform Web SDK: the base code, the configure command and a sendEvent call with an XDM payload skeleton. The code is built in your browser and nothing is sent anywhere.

Built in your browser. This page only writes text. It sends nothing to Adobe or to us. It does not ask for your datastream ID, your organisation ID or any key: the code carries the placeholders YOUR_DATASTREAM_ID and YOUR_ORG_ID@AdobeOrg, which you replace on your own machine.

Library
2.37.1 was the newest version in Adobe's release notes on 13 November 2026. Check the release notes before you fix a version.
Consent
Which default is right for your visitors is a decision for your privacy or legal team. See consent with the Web SDK.
Settings

Automatic data (context)
The first four are Adobe's default. The context line is written only when your choice differs from the default.

Event to send

Web SDK 2.37.1: page view

<!-- Adobe Experience Platform Web SDK starter. Replace YOUR_DATASTREAM_ID and YOUR_ORG_ID@AdobeOrg. -->
<!-- Part 1: place inside the head, as high as possible. -->
<!-- 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/2.37.1/alloy.min.js" async></script>
<!-- Configure: first command on every page -->
<script>
  alloy("configure", {
    "datastreamId": "YOUR_DATASTREAM_ID",
    "orgId": "YOUR_ORG_ID@AdobeOrg"
  });
</script>

<!-- Part 2: send the event once the page data is ready. Values in capitals are placeholders. -->
<script>
  alloy("sendEvent", {
    "type": "web.webpagedetails.pageViews",
    "xdm": {
      "web": {
        "webPageDetails": {
          "name": "PAGE_NAME",
          "pageViews": {
            "value": 1
          }
        }
      }
    }
  });
</script>

  • This payload needs the Web Details field group on the schema of the datastream's event dataset.
  • Replace YOUR_DATASTREAM_ID and YOUR_ORG_ID@AdobeOrg on your own machine. Values in capitals inside the xdm object are placeholders too.
  • configure must run once on every page load, before any other command.

How it works

What the builder writes

Head code

Adobe's base code, the library loader for the version you choose (2.37.1, dated 4 November 2026, was the newest on the day we checked) and the configure command. Settings left at Adobe's default are not written.

configure and sendEvent

An event with an XDM skeleton

A sendEvent call for a page view, link click, product view, add to cart, purchase or your own event type, with the XDM fields from Adobe's Web Details and Commerce Details field groups.

XDM schemas and field groups

Consent and prehiding

defaultConsent, an optional setConsent example in the Adobe 2.0 or 1.0 standard, and Adobe's prehiding snippet or prehidingStyle, depending on how the library loads.

Consent with the Web SDK
  • Placeholders only. The datastream ID and organisation ID are never asked for. The page has no field for them and keeps nothing after you close the tab.
  • Verified against the documented format. Checked on Adobe's Experience League pages on 13 November 2026. Not run against a live datastream.
  • Moving from older libraries. While some pages still use the older libraries, leave the AMCV cookie option ticked and tick the at.js option. The tag scan shows which libraries a live site loads, and the Analytics to CJA check maps your variables to XDM paths.

Questions

Common questions

Does this page send anything to Adobe?

No. The code is built in your browser and shown as text. Nothing is sent to Adobe or to us. You paste the code into your own site.

Where do I put my datastream ID and organisation ID?

Not here. The code carries the placeholders YOUR_DATASTREAM_ID and YOUR_ORG_ID@AdobeOrg. Replace them on your own machine. Adobe's pages say where to find each one.

What was checked against Adobe's documentation?

The base code and library address, the configure properties and their defaults, the prehiding snippet, the sendEvent options, the two Adobe consent objects, the event type values and every XDM field in the payload skeletons. Each was read on Adobe's Experience League pages on 13 November 2026.

What was not verified or is left out?

We did not run the code against a live datastream, so it is checked against the documented format only, and your schema decides whether a payload is accepted. Left out: thirdPartyCookiesEnabled, the clickCollection object, onBeforeEventSend, datastream overrides, the IAB TCF consent object, the data object and the tag extension.

Will the payload match my schema?

Only if your schema has the matching field group: Web Details for page views and link clicks, Commerce Details for the commerce events. Values in capitals, such as PAGE_NAME and SKU_1, are placeholders for your own data.

Can a value I type break the generated code?

No. Every typed value is written as a JSON string with the angle brackets, the ampersand, quotes and non-English letters as Unicode escapes, so it cannot close the script element or the string. The version must be three numbers and the edge domain must be a plain host name.

Sources

What the code was checked against

Surge Migrate is not affiliated with Adobe and claims no Adobe partner status. More answers: Adobe Experience Platform hub.

Surge Migrate

Moving the website itself

This builder writes data collection code. 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 →