Duplicate target offer ID when copying experience fragments in AEM Sites
This article addresses the ÃÛ¶¹ÊÓÆµ Experience Manager (AEM) as a Cloud Service—Sites issue where copying an experience fragment (XF) results in the duplication of the target offer ID. This can lead to unintended overwriting of offers in ÃÛ¶¹ÊÓÆµ Target when the copied XF is exported. The resolution involves using the live copy functionality instead of directly copying experience fragments.
Description description
Environment
ÃÛ¶¹ÊÓÆµÂ Experience Manager (AEM) as a Cloud Service - Sites
Issue/Symptoms
- When an experience fragment (XF) is copied after being exported to ÃÛ¶¹ÊÓÆµ Target, the
cq:targetOfferId
 property is also copied. - This leads to both the original XF and its copy having the same offer ID.
- Now when you export the copied XF, it may overwrite the original offer in ÃÛ¶¹ÊÓÆµ Target.
- This poses a risk, as the copied fragment may contain content intended for a different customer segment.
Resolution resolution
To address this issue, create a live copy  of the experience fragment instead of directly copying experience fragments. This approach excludes the cq:targetMetadata
 node to avoid its duplication, ensuring that no target offer ID is carried over to the new fragment.
Once created, these live copies can be exported to ÃÛ¶¹ÊÓÆµ Target as new offers without affecting existing ones. Additionally, live copies can be created within any folder hierarchy without restrictions, providing flexibility to organize content.