Hi everyone,
I am migrating from at.js to the AEP Web SDK and trying to replicate a common workflow we used with Form-Based Activities.
The Scenario: In at.js, I could create a Form-Based Activity with a custom mbox location (e.g., my-custom-scope) and return an HTML Offer containing JavaScript (e.g., <script>console.log('test');</script>). This script would execute automatically when the offer was delivered.
The Problem with Web SDK: I am able to successfully fetch the offer using alloy("sendEvent", { decisionScopes: ["my-custom-scope"] }). I can see the HTML content in the propositions payload in the network response.
However, the script inside the HTML offer does not execute automatically.
My Question: What is the best practice in Adobe Launch (Tags) to handle this automatically?
Do I need to manually chain an applyPropositions command after every sendEvent?
Is there a specific configuration in the "Send Event" action within Launch that tells the Web SDK to automatically render/execute scripts found in specific decision scopes?
Or do I need to write a custom "Success" handler rule to parse the propositions and inject the script tags into the DOM manually?
I am trying to avoid writing custom JavaScript handlers for every single form-based activity and want to rely on Launch configuration as much as possible.
Any guidance or screenshots of a Launch Rule setup would be appreciated!
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @shaikhshoeb
In Form-based Experience Composer, Content delivered to custom scopes is not rendered automatically by the Platform Web SDK. It can be rendered using an action types in Tags (Launch).
You can modify your page load rule to add a custom decision scope. Add a scope to send event action
please find the screenshots at below link.
and then process the response from target using applyProposition action type
In case you've several decision scopes that are intended for specific pages, then you should consider using a data element that returns an array of scopes conditionally depending on the page path.
Views
Replies
Total Likes
Hi @shaikhshoeb
In Form-based Experience Composer, Content delivered to custom scopes is not rendered automatically by the Platform Web SDK. It can be rendered using an action types in Tags (Launch).
You can modify your page load rule to add a custom decision scope. Add a scope to send event action
please find the screenshots at below link.
and then process the response from target using applyProposition action type
In case you've several decision scopes that are intended for specific pages, then you should consider using a data element that returns an array of scopes conditionally depending on the page path.
Views
Replies
Total Likes
Hi there,
Thank you so much for your input! This was exactly what I needed.
I was able to get it working by chaining the Apply Propositions action after my Send Event.
To handle the <script> tag execution, I configured the Apply Propositions action with:
Selector: body
Action Type: appendHtml
Is this the recommended/correct approach for injecting scripts to ensure they execute immediately? I just want to ensure I’m following best practices by appending it directly to the body.
Thanks again for the help!
Views
Replies
Total Likes
Hi @shaikhshoeb Glad to know that it's working for you and yes it's recommended approach.
Thank you 🙂
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies