What Is Alloy.js? Adobe Alloy Web SDK Implementation Guide

Adobe Analytics BCS 10 months ago (11-19) 1709 Views 0 Comments

Updated: November 19, 2025

Do you need to send data to Adobe Experience Platform Edge Network but do not want to use Adobe Launch?

You can use Adobe Alloy, the standalone JavaScript library for Adobe Experience Platform Web SDK. It lets your website send data directly to Adobe Edge Network with JavaScript.

The closest GA4 comparison is gtag.js: both can be added directly to the website without using a tag-management interface. However, Alloy is not an Adobe Analytics-only library. It is the client-side Web SDK that sends XDM-based data to Adobe Edge Network, which can then route data to Adobe Analytics, Adobe Target, and other configured destinations. 

In this guide, you will learn how to install Alloy, configure it, send an event, and decide whether direct Alloy deployment or Adobe Launch is the better option.

What Is Alloy?

Alloy is the JavaScript library behind Adobe Experience Platform Web SDK.

The basic data flow is:

Website → Alloy (Web SDK) → Adobe Edge Network → Adobe solutions and destinations

What Is Alloy.js? Adobe Alloy Web SDK Implementation Guide

Alloy Code and Deployment

Step 1: Load the Alloy Library

Adobe hosts both minified and unminified Alloy files on its CDN.

  • Minified version: https://cdn1.adoberesources.net/alloy/2.14.0/alloy.min.js
  • Unminified version: https://cdn1.adoberesources.net/alloy/2.14.0/alloy.js

Adobe recommends adding the base code and library loader as high as possible in the page <head>, before scripts that call Alloy.

<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[o].q.push([i,l,u])})},n[o].q=[])})}
  (window,["alloy"]);
</script><script src="https://cdn1.adoberesources.net/alloy/2.14.0/alloy.min.js" async=""></script>

 

Step 2: Configure Alloy

The first Alloy command on a page must be configure.

alloy("configure", {
  "edgeConfigId": "ebebf826-a01f-4458-8cec-ef61de241c93",
  "orgId": "ADB3LETTERSANDNUMBERS@AdobeOrg"
});

Replace:

  • edgeConfigId: The Edge Server configuration ID
  • orgId: Adobe Organization ID

Combining the base SDK code with the configuration produces a basic tracking setup similar to GA4, such as:

<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
<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[o].q.push([i,l,u])})},n[o].q=[])})}
  (window,["alloy"]);
</script><script src="https://cdn1.adoberesources.net/alloy/2.14.0/alloy.min.js" async=""></script><script>
alloy("configure", {
  "edgeConfigId": "ebebf826-a01f-4458-8cec-ef61de241c93",
  "orgId":"ADB3LETTERSANDNUMBERS@AdobeOrg"
});
</script>

After this configuration runs, Alloy knows which Adobe Edge Network configuration should process your requests.

 

Step 3: Send a Page View

Use the sendEvent command to send data to Adobe.

alloy("sendEvent", {
  "xdm": {
    "web": {
      "webPageDetails": {
        "URL": document.location.href,
        "isErrorPage": {{Error Page}},
        "name": document.title,
        "server": "bbccss.com"
      }
    }
  },
  "data": {
    customString: "example"
  }
});
  • xdm: Standard data following the XDM Schema, which must be defined in advance
  • data: Custom business-specific fields

This sends page information to Adobe Edge Network.

The xdm object must match your configured XDM schema. Do not add fields just because they look useful—if the schema does not contain the field, Adobe Experience Platform cannot process it as intended.

Sending Custom Data

You can send custom fields in two ways.

Use xdm for schema-based data

Use xdm when the field exists in your XDM schema.

alloy("sendEvent", {
  xdm: {
    eventType: "web.webpagedetails.pageViews",
    web: {
      webPageDetails: {
        URL: window.location.href,
        name: document.title
      }
    },
    custom: {
      pageCategory: "analytics"
    }
  }
});
Your schema must include the custom.pageCategory field or an equivalent custom field path.

Use data for non-XDM data

Use data when you are sending non-XDM fields, such as values that Data Prep will map later.

alloy("sendEvent", {
  data: {
    page_category: "analytics",
    content_author: "Haran"
  }
});
The data object does not automatically become XDM. Configure Data Prep mappings if the destination requires those values to be mapped to XDM fields

How to Verify Alloy Is Working

Open browser Developer Tools, then go to the Network tab.

  • Reload the page.
  • Search for requests containing interact.
  • Open the request and inspect the payload.
  • Confirm that your xdm or data values are included.

You can also use Adobe Experience Platform Debugger to confirm that the Web SDK library loaded and requests were sent.

Final Words

Alloy is the standalone JavaScript implementation of Adobe Experience Platform Web SDK. It sends data from the browser to Adobe Edge Network without requiring Adobe Launch.

The basic implementation is straightforward: load Alloy, configure the datastream, and call sendEvent.

However, a direct Alloy implementation becomes more complex as your event tracking grows. For most teams, Adobe Launch with the Web SDK extension is easier to maintain. Use direct Alloy when your development team wants to manage the full implementation in code.

Like (0)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website