Updated: November 19, 2025
What is Alloy?
Within the Adobe ecosystem, Alloy can be understood as the equivalent of gtag in GA4. It allows you to send data directly to Adobe’s Edge Server without going through Adobe Launch.
Alloy Code and Deployment
Getting the Alloy JS
Adobe provides two versions of the Alloy JS via 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
Place the script as high as possible within the <head> tag to ensure the JS is available when the page loads:
<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>
Note: Alloy uses Promise for asynchronous handling. Since IE does not support Promise, you need to include a Promise polyfill before the base code if IE support is required.
Add the Promise polyfill code before the base code:
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
The complete version is as follows:
<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>
Initializing Alloy
Next, configure the data flow to specify which Edge Server the data should be sent to:
alloy("configure", {
"edgeConfigId": "ebebf826-a01f-4458-8cec-ef61de241c93",
"orgId": "ADB3LETTERSANDNUMBERS@AdobeOrg"
});
edgeConfigId: The Edge Server configuration IDorgId: Adobe Organization ID
Combining the base SDK code with the configuration produces a basic tracking setup similar to GA4.
Complete JS Tracing Code
The base code can be combined with the configuration data flow code, similar to the base tracing code in 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>
Sending Data
Use the sendEvent command to send events in the XDM format:
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 advancedata: Custom business-specific fields
In theory, you can deploy Adobe Analytics using GTM + Alloy, sending all data in JSON format. However, this approach requires managing large JSON structures, which can be cumbersome.
Recommended Deployment Approach
It is recommended to use the Web SDK via Adobe Launch:



