在AEM 6.2上使用contexthub进行个性化的Publish实例上不可见的优惠/体验

时间:2017-06-25 06:07:12

标签: aem personalization

我正在使用AEM的默认定位为用户添加体验。我使用“性别等于男性”作为一个简单的特征来尝试显示示例文本。

我已经设置为登录用户创建体验,以根据他们的性别查看不同的TEXT(作为示例)。在发布内容并登录到Publish上的门户网站时,我看不到体验(应该出现不同的文本)。甚至不会出现默认值。

enter image description here

很少有观察结果:

  1. 在作者上我可以在/ etc / segmentation / contexthub / my-audience下看到受众特征,但在Publish实例上却没有。我假设这将与页面一起发布,但是没有发生。
  2. 如果登录用户没有/ content / campaign的权限,那么我会在日志中看到此错误。如果我给予权限,那么我没有看到。我可以假设组件正在加载吗?

    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. 如果我们查看页面源代码,我们会看到以下内容。 " CAMPAIGNNAME"是空的吗?

    <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. 我们通过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
    
  5. 我缺少什么?

1 个答案:

答案 0 :(得分:1)

在此处添加分辨率以供参考:

默认体验会显示以下更改:

  1. 更改了代码
    <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>
    
  2. 就这样:

    <sly data-sly-resource="${'contexthub' @ resourceType='granite/contexthub/components/contexthub'}"/>
    
    1. 在Dispatcher的publish-farm.any

      中启用以下网址
      /0036 { /type "allow" /url "/etc/cloudsettings*" }
      /0037 { /type "allow" /url "/etc/segmentation*" }
      
    2. 您也可以在Author实例上使用此工具来检查ContextHub设置: http://localhost:4502/etc/cloudsettings/default/contexthub.diagnostics.html