AEM's preview mode for Campaign users and targeted contents | Community
Skip to main content
Kornel_Keseru
Level 3
March 7, 2017

AEM's preview mode for Campaign users and targeted contents

  • March 7, 2017
  • 3 replies
  • 8883 views

Hi,

I've followed the steps on https://docs.adobe.com/docs/en/aem/6-2/author/personalization/adobe-campaign/target-adobe-campaign.html to setup targeted contents for campaign segments.

However, when previewing the page by selecting a persona that is linked with Adobe Campaign (seed addresses), the personalization properties (e.g. firstname, lastname) are displayed properly, but the targeted sections show the default contents, altough targetData.segmentCode comes from Campaign as expected and matches the rule setup in the campaign trait.

The targeted contents appear in the emails generated by the Campaign delivery as expected. So the only thing that doesn't work is the preview in AEM.

Has anybody setup preview for targeted contents with Campaign users already?

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Daniel_H__A__Li
Level 2
March 7, 2017

Hi, Kornel. How are you?

Kornel, I was able to make the preview mode work by following the steps described here:

Personalization in AEM 6.2

But I was using ContextHub as engine instead of Adobe Target or Client Context and the segments for ContextHub are different from the segments for Client Context (as far as I've understood, we can't mix them).

Regards,

Daniel.

smacdonald2008
Level 10
March 7, 2017

See this HELPX article: https://helpx.adobe.com/experience-manager/using/aem_campaign.html

This provides more detail. 

Kornel_Keseru
Level 3
March 8, 2017

Thanks for your replies! My investigation so far shows that only the "Segment ID trait" from the "Segmentation - Adobe Campaign" component group will result in such segment that will work properly during the targeting in a targeted Adobe Campaign delivery. However segments built with this one won't be resolved in preview mode on the touch UI using persona from the context hub. So it seems that either I have working preview in AEM (Contexthub+TouchUI) or working targeting in Campaign, but not both. This is not a blocker, as I can preview the targeted contents in targeting mode, but would be nice to make it working on the touch UI and contexthub segments. Maybe in 6.3?

daniel_henriqu1
Level 4
March 8, 2017

Hi, Kornel.

By reviewing our conversation, I think I got the wrong end of the sticky...

I was able to use both Targeting mode and Preview Mode (ContextHub + Touch UI) in AEM 6.2 even for regular components, such as the text component and the title component.

Targeting those components will generate some page "fragments" (I don't recall the correct name for this type structure/component) under the corresponding Campaign, containing the value set for each selected segment.

What kind of issues have you been facing?

Has your Campaign been set to use ContextHub?

Have your segments been created as ContextHub Segments instead of "regular" (Client Context) segments?

Do your page templates/components include the context hub client library (it's a cq:include in the pages)?

Regards,

Daniel.

daniel_henriqu1
Level 4
June 27, 2017

Thanks for the checkpoints.

1. Yes

2. The targeted content data does not show up on publisher if it is targeted. Not even the default experience

3. No

4. Screenshot below

5. Do not see any specific.

Also observed this on the page source:

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>

Here's a summary of the issue:


Hi, konathalasuren.

You can try a few things:

1. Using the JavaScript console, add a breakpoint to "if (window.ContextHub && ContextHub.SegmentEngine) {" and reload the page

If the if body doesn't get called, the include of the contexthub JS library is probably at the wrong place.

Move it to the <head> of the page.

2. Using the JavaScript console, open contexthub.kernel.js, add a breakpoint to the second occurrence of "return resolvedSegments" and reload the page

At the first time, the resolvedSegments will be empty. Click on continue.

At the second time, inspect the resolveSegments object. Your custom segment(s) should be there.

Another way of checking this is by enabling debug and disabling silent mode of the ContextHub framework on your publish instance, but this is very verbose.

If your segment(s) is(are) not there:

  1. open it(them) for edition and check its(their) rules;
  2. try to replicate/activate it(them).

3. Check if the "master area" of your campaign is active/published

The master area is the parent page of your campaign. For some reason, the master area appears only in the classic UI:

http://localhost:4502/siteadmin#/content/campaigns


Regards,

Daniel.

ContextHub.SegmentEngine.PageInteraction