Friday, October 11, 2024

Syncing Segments from Adobe Target to Adobe Experience Manager (AEM)

While integrating Adobe Target with AEM, you can synchronize segments from Adobe Target to AEM. Basic configurations include:

  • Enabling the project with the Adobe Target API in the Adobe Developer Console.
  • Enabling the required workspaces and ensuring proper access for the API credentials via the Admin Console Product Profile (Workspace).
  • Setting up the IMS configuration in AEM.
  • Enabling the Adobe Target Cloud Configuration with segment syncing.


(I will be posting a detailed guide on the integration process soon.)

Issue: Segments Not Syncing

Unfortunately, even after completing all the steps, the segments were not syncing, and I encountered the following exception:

11.10.2024 12:08:37.246 *WARN* [sling-cq-polling-importer-2-/conf/wknd/settings/cloudconfigs/target] com.day.cq.polling.importer.impl.PollingImporterImpl importData: Failed to import PollConfig(/conf/wknd/settings/cloudconfigs/target/jcr:content/segmentsPollConfig): scheme=adobe-target-segments,source=/conf/wknd/settings/cloudconfigs/target,target=/etc/segmentation/adobe-target/tenant,interval=300s,enabled=true

java.lang.NullPointerException: null

at com.day.cq.analytics.testandtarget.impl.SegmentImporter.importData(SegmentImporter.java:159) [com.adobe.cq.cq-target-integration:1.4.60]

at com.day.cq.polling.importer.impl.PollingImporterImpl.importData(PollingImporterImpl.java:561) [com.day.cq.cq-polling-importer:5.13.2]

at com.day.cq.polling.importer.impl.PollingImporterImpl.access$000(PollingImporterImpl.java:72) [com.day.cq.cq-polling-importer:5.13.2]

at com.day.cq.polling.importer.impl.PollingImporterImpl$1.run(PollingImporterImpl.java:463) [com.day.cq.cq-polling-importer:5.13.2]

at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:349) [org.apache.sling.commons.scheduler:2.7.12]

at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [org.apache.sling.commons.scheduler:2.7.12]

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at java.base/java.lang.Thread.run(Thread.java:834)


Resolution

To resolve this issue, ensure that the Day CQ Analytics Segment Importer configuration is enabled.


Additionally, segments will only sync from the Default Workspace at present. Ensure that segments are created under the Default Workspace. In my case, there were no segments under the Default Workspace, which caused the sync to fail.

You can also adjust the polling interval in the Adobe Target Cloud Configuration.

You can adjust the polling interval on Adobe Target Cloud Configuration



Successful Sync

Once I created segments in the Default Workspace, they were successfully synced to the AEM Audience Library. These segments can now be used for A/B testing or Experience Targeting for AEM pages using Adobe Target as the targeting engine.


11.10.2024 14:23:02.976 *INFO* [sling-cq-polling-importer-3-/conf/wknd/settings/cloudconfigs/target] com.day.cq.analytics.testandtarget.impl.SegmentImporter Importing in /etc/segmentation/adobe-target/tenant with dataSource /conf/wknd/settings/cloudconfigs/target

11.10.2024 14:23:02.978 *DEBUG* [sling-cq-polling-importer-3-/conf/wknd/settings/cloudconfigs/target] com.day.cq.analytics.testandtarget.impl.service.WebServiceImpl Target API Request: GET https://mc.adobe.io/tenant/target/audiences?offset=0&modifiedAt=2024-10-10%2F2024-10-12&limit=2000&type=reusable 

11.10.2024 14:23:03.517 *DEBUG* [sling-cq-polling-importer-3-/conf/wknd/settings/cloudconfigs/target] com.day.cq.analytics.testandtarget.impl.service.WebServiceImpl Target API Request: GET https://mc.adobe.io/tenant/target/audiences?deletedAt=2024-10-10%2F2024-10-12&offset=0&limit=2000&type=reusable&status=deleted 

11.10.2024 14:23:03.985 *INFO* [sling-cq-polling-importer-3-/conf/wknd/settings/cloudconfigs/target] com.day.cq.analytics.testandtarget.impl.SegmentImporter Wrote 4 segments under /etc/segmentation/adobe-target/tenant 



Creating Adobe Target Audiences

You can create Adobe Target Audiences in AEM, and they will sync to Adobe Target's Default Workspace.







11.10.2024 14:55:59.150 *DEBUG* [[0:0:0:0:0:0:0:1] [1728676559144] POST /conf/wknd/settings/cloudconfigs/target/jcr:content.audienceupdate.json HTTP/1.1] com.day.cq.analytics.testandtarget.impl.service.WebServiceImpl Target API Request: POST https://mc.adobe.io/tenant/target/audiences?includeMarketingCloudMetadata=true {"name":"Windows","description":"--","targetRule":{"script":"return (((user.browser!=null) && (user.browser.indexOf(\"Windows\")>-1)));"},"type":"reusable","marketingCloudMetadata":{"sourceProductName":"Adobe Experience Manager","editURL":"http://localhost:4502/libs/cq/personalization/touch-ui/content/audiences.html"}}

No comments:

Post a Comment