Issue Description
When the AEM is integrated with Target through Adobe I/O and an XT activity is created in AEM and synced to target, the end-user personalization fails to work as expected on the end site. Instead of replacing only the personalized part of the HTML, the whole HTML is being replaced with personalized content.
Steps to reproduce
- Created an Adobe I/O integration for target API under default workspace
- Provided this integration "Editor" product role in admin console
- Created IMS Configuration, Legacy target integration configuration in AEM. Connection is verified to be successful.
- Enabled context hub at template level.
- Created a new brand under personalization.
- In sites added the configuration path and added target cloud configuration.
- Opened a page, add a text component
- Switched to targeting mode.
- Selected my brand and created an activity
Step9
10. Selected the text component and clicked on target
Step10
11. Configured the target options. Provided a custom mbox id
Step1112. Configured two experiences for two audiences (Chrome and firefox users) and corresponding text in the text component.
Step1213. Saved the activity with metrics as Engagement and page views.
LastStep
Issue
When I view the targeted page in publish or select "View as published" in author, I just see the personalized content covering the entire page.
actual behaviour
Expected Behavior
Only the default content should be replaced with personalized content, not the entire page.
Expected
Issue Analysis
1. When the offers are created using API, instead of configured custom mbox, a place holder is being sent.
Log entry:
23.04.2020 11:43:48.573 *DEBUG* [0:0:0:0:0:0:0:1 [1587622426050] POST /libs/cq/analytics/testandtarget/command HTTP/1.1] com.day.cq.analytics.testandtarget.impl.service.WebServiceImpl Target API Request: POST https://mc.adobe.io/xyz/target/offers/content {"name":"apr-23-wknd-mbox--author-chrome_browser-targettest1-text","content":"<script type='text/javascript'>(function() { CQ_Analytics.TestTarget.pull('/content/campaigns/wknd/master/April23-TestActivity/chrome_browser/targettest1-text.tandt.html','${mbox.name}','1.0.0');})();<\/script>"}
This can be verified in Adobe Target also – in offers
![issue1.png issue1.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/23504i9702FB7D7DD2EE15/image-size/large/is-moderation-mode/true?v=v2&px=999)
2. Hence, the global mbox id is received as response from target API call (Instead of custom mbox id)
Request:
![issue2.png issue2.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/23505iA3D9A9B631CDFD3C/image-size/large/is-moderation-mode/true?v=v2&px=999)
Response:
![issue3.png issue3.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/23506iF78654819DDEEB3E/image-size/large/is-moderation-mode/true?v=v2&px=999)
3. If I edit the offer in target and replace the placeholder with my custom mbox id, the targeting is working fine.
![issue4.png issue4.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/23507iF952BF2207611825/image-size/large/is-moderation-mode/true?v=v2&px=999)
![issue5.png issue5.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/23508i6D0A326AE3CE4CF0/image-size/large/is-moderation-mode/true?v=v2&px=999)
Question:
Can the mbox be sent in request while creating an offer instead of sending a '${mbox.name}' placeholder ?