I am trying to use Target Groups in my site. I've just created one, published it and added it in one of the components of the page:

enter image description here

The problem is that in the DXA I cannot see anywhere the information related to target groups in the PageModel. I see the components mapped into Entities with all their fields, but I cannot find that information. Anyone knows how to do it? Thanks a lot!

enter image description here

  • Which version of DXA are you using? Please add a tag for the version. – Rick Pannekoek Nov 5 '18 at 17:37
  • @RickPannekoek done! We're using the 1.7 version – Mer Nov 6 '18 at 6:44

In DXA 1.x you can use the DD4T TBB AddTargetGroups to add Target Group Conditions to the DD4T Data Model (what Velmurugan and Harald are referring to is the DXA 2.0 equivalent of this TBB which works with the DXA R2 Data Model).

However, DXA does not have OOTB logic to do something with these Target Group Conditions in the Web Application.

Part of the problem is that Target Group Conditions require legacy Personalization & Profiling functionality to evaluate and this functionality is not exposed in the CIL (but only in the legacy, in-process CD API).

However, you can use the DXA Context Expressions Module to work with Target Groups with Context Expressions specifically. This DXA Context Expressions Module comes with a so-called Conditional Entity Evaluator which uses the Context Engine to evaluate the Context Expression and based on that includes or excludes the Entity Models (associated with the conditional Component Presentations) in the Page/Region Model.

  • Ok, we'll try with the alternatives. Thanks, Rick! – Mer Nov 7 '18 at 14:23

I believe that the target group information should be present on the level of component presentations, so in the entities. I also think (but i'm not fully certain) that DXA stores this information in the ExtensionData dictionary.

In your screenshot you are only showing properties of the page and of a region, could you expand the entities as well ?

  • Hi Harald, I've already searched it in the Entity which has the Target Group added in its component presentation, but it's not there as you cas see imgur.com/Kqu1LOd ExtensionData is algo empty. – Mer Nov 6 '18 at 6:41

It will only generate tags if you Create a Target Group and then Add Target group with a component presentation on the page.

AddTargetGroupsModelBuilder should be updated in RenderPageContent TBBs

JSON output looks like this:

"ExtensionData": {
            "TargetGroupConditions": {
              "$type": "Condition[]",
              "$values": [
                  "$type": "CustomerCharacteristicCondition",
                  "Name": "member",
                  "Operator": 0,
                  "Value": "10",
                  "Negate": false

To read more about this how to create a target group and associate, have a look at the documentation "Target Groups"

Could you please preview your page and share the JSON output from CME?

I hope it helps.

  • Hi @Velmurugan, right now my RenderPageContent Template contains this imgur.com/etOiz5D Do you mean I should remove that (Generate Dynamic Page (DXA)" and add "Add Target Groups"? imgur.com/QPIjSQJ Thanks a lot for your help – Mer Nov 6 '18 at 6:33
  • I've tried doing what I said in the last comment, and even adding "Add Target Groups" without deleting the other one and the ExtensionData field does not appear. I think the problem is that as we are working with dxa 1.7 we don't have "AddTargetGroupsModelBuilder", is that correct? Which alternative could we try? Thanks! – Mer Nov 6 '18 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.