1

I’m using AEM’s default targeting to add an experience for a user. I’m using “gender equals male” as a simple trait to try the sample text to show up.

I’ve setup to create an experience for logged in users to see different TEXT based on their gender (as an example). And on Publishing the content and login into to our portal on Publish, I cannot see the experience (a different text should appear). Not even the default would appear.

enter image description here

Few observations:

  1. On Author i can see the Audience traits under /etc/segmentation/contexthub/my-audience but the same is not there on Publish instance. I'm assuming this will be published along with the page, but is not happening.
  2. If the logged-in user does not have permission to /content/campaigns, then i see this error in the logs. If i give permissions then i do not see. Can i assume the component is loading?

    2017 03:01:22.427 *WARN* [192.150.10.207 [1498374082395] GET /content/brand/en-us/emp.html HTTP/1.1] com.day.cq.personalization.impl.AreaServiceImpl Area at /content/campaigns/ups/master not found or not accessible.
    
  3. If we look at the page source, we see the below. "campaignName" is empty?

    <div class="target parbase">
        <script type="text/javascript">
            if (window.ContextHub && ContextHub.SegmentEngine) {
                ContextHubJQ(function() {
                    ContextHub.SegmentEngine.PageInteraction.Teaser({
                        locationId: '_content_brand_en-us_comms_jcr_content_searchpar_title_631229628',
                        variants: [{"path":"/content/brand/en-us/comms/default","name":"default","title":"Default","campaignName":"","thumbnail":"/content/brand/en-us/comms.thumb.png","url":"/content/brand/en-us/comms/_jcr_content/searchpar/title_631229628.default.html","tags":[]}],
                        strategy: 'first',
                        trackingURL: null
                    });
                });
            }
        </script>
        <div id="_content_brand_en-us_comms_jcr_content_searchpar_title_631229628" class="campaign ">
          <noscript><div class="default title">
          <div class="ups-title">
            <h1 class="title-text">Default Title</h1>
          </div>
         </div>
         </noscript>
    </div>
    
  4. We are enabling the below url's through Dispatcher.

    /0024 { /type "allow" /url "/etc/segmentation.segment.js" }
    /0025 { /type "allow" /url "/etc/clientcontext*" }
    /0026 { /type "allow" /url "/libs/cq/personalization/components/clickstreamcloud/content/config.json" }
    /0027 { /type "allow" /url "/libs/wcm/stats/tracker.js" }
    /0028 { /type "allow" /url "/libs/cq/personalization/*" }
    /0062 { /type "allow" /glob "* /libs/cq/personalization/*" }  # enable personalization
    

What am i missing?

Suren Konathala
  • 3,497
  • 5
  • 43
  • 73
  • If you thinkma script path is blocked... Try accessing without dispathcer. Alternatively, if scripts are blocked you will see a lot of 404 in your browser console. – Imran Saeed Jun 25 '17 at 18:09
  • I tried it without Dispatcher but the same, page loads without the experience. – Suren Konathala Jun 25 '17 at 20:26
  • Are the experiences even published properly? Can you check via crx/de if nodes are there on publish servers? – Imran Saeed Jun 26 '17 at 11:07
  • Yes i checked them and they are all published. But i observed one thing: On author i can see my Audience under "etc/segmentation/contexthub" but not under Publish. How can i publish them? – Suren Konathala Jun 26 '17 at 18:07
  • /etc/segmentation needs to be published. You can do it via crx/de or just use tree activation – Imran Saeed Jun 26 '17 at 18:09
  • Thanks. I was able to successfully publish them using Activate Tree and selecting only /etc/segmentation. But the problem still persists. – Suren Konathala Jun 26 '17 at 18:30

1 Answers1

1

Adding resolution here for reference:

The default experiences shows with the below changes:

  1. Changed the code from

    <sly data-sly-test="${!wcmmode.disabled}">
      <div data-sly-call="${clientLib.all @ categories='personalization.kernel'}" data-sly-unwrap></div>
      <div data-sly-resource="${'config' @ resourceType='cq/personalization/components/clientcontext_optimized/config'}" data-sly-unwrap></div>
      <div data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}" data-sly-unwrap></div>
    </sly>
    <sly data-sly-test="${!wcmmode.disabled}">
      <div data-sly-include="/libs/cq/cloudserviceconfigs/components/servicelibs/servicelibs.jsp" data-sly-unwrap></div>
      <meta data-sly-call="${clientLib.all @ categories='cq.apps.targeting'}" data-sly-unwrap></meta>
    </sly>
    

To just this:

<sly data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}"/>
  1. Enabled the below urls in the Dispatcher's publish-farm.any

    /0036 { /type "allow" /url "/etc/cloudsettings*" }
    /0037 { /type "allow" /url "/etc/segmentation*" }
    

Also you can use this tool on Author instance to check the ContextHub settings: http://localhost:4502/etc/cloudsettings/default/contexthub.diagnostics.html

Suren Konathala
  • 3,497
  • 5
  • 43
  • 73