Using the Last Event Service JavaScript Library with Adobe Experience Platform Web SDK

Advertisers with an Advertising Cloud-Adobe Analytics Integration Only

If your organization uses the legacy Adobe Analytics visitorAPI.js library for data collection, you can optionally switch to using the Adobe Experience Platform Web SDK library (alloy.js), which allows you to interact with the various Experience Cloud services through the Edge Network.

The Analytics for Advertising Cloud Last Event Service JavaScript library, as-is, records view-through and click-through events and stitches them to the associated conversions using a supplemental ID (SDID). The Web SDK library, however, doesn’t supply a stitch ID. To use the Web SDK for Analytics for Advertising Cloud, you’ll need to modify 1) the Last Event Service tag you use on your webpages and 2) your Web SDK sendEvent commands accordingly.

Step 1: Edit Your Last Event Service Tag to Generate a StitchID

In the Analytics for Advertising Cloud Last Event Service tag you use on your webpages, add code to generate the StitchID using the random ID generator that’s bundled in the library.

Legacy tag:

<script>
     if("undefined" != typeof AdCloudEvent) 
          AdCloudEvent('IMS ORG Id');
</script>

New tag:

<script>
     if("undefined" != typeof AdCloudEvent) 
          stitchId = AdCloudEvent('IMS ORG Id').generateRandomId();
</script>

Step 2: Use Web SDK to Send the StitchID as XDM Data for Analytics

Insert the following property within your Web SDK sendEvent command to send the StitchID to Experience Edge as Experience Data Model (XDM) data for Analytics. Analytics will use the value as an SDID.

Property to add:

     "_adcloud": {
       "advertisingStitchID": stitchId
     }

Example:

<script>
  alloy("sendEvent", {
    "xdm": {
      "commerce": {
        "order": {
                ………
        }
     },
     "_adcloud": {
       "advertisingStitchID": stitchId
     }
    }
  });
</script>

On this page