Step 3: Verify the rule artifact download using at.js custom events

The at.js library dispatches two new custom events to support on-device decisioning.

  • adobe.target.event.ARTIFACT_DOWNLOAD_SUCCEEDED
  • adobe.target.event.ARTIFACT_DOWNLOAD_FAILED

You can subscribe to listen to these custom events in your application to action upon success or failure of the artifact rules file download.

The following example shows a sample of code listening to artifact download success and failure events:

document.addEventListener(adobe.target.event.ARTIFACT_DOWNLOAD_SUCCEEDED, function(e) {
  console.log("Artifact successfully downloaded", e.detail);
}, false);

document.addEventListener(adobe.target.event.ARTIFACT_DOWNLOAD_FAILED, function(e) {
  console.log("Artifact failed to download", e.detail);
}, false);
Previous pageRule artifact
Next pageat.js functions overview

Target


Personalization & Experiementation Excellence with Recommendations and AI

Adobe Customer Success Webinars

Tuesday, Mar 4, 4:00 PM UTC

Adobe Target innovations, including GenAI, and best practices on AI-powered personalization and experimentation at scale.

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more