4

I know that CQ5 have tools to help divide visitors into different segments based on particular segment traits.

By default there are about a dozen built in segment traits like "IP Range", "Visitor Age", "Facebook Profile", "Referral Keywords" etc.

But how do we create other traits that's not avaliable out of the box? For example, if we wanted to filter visitors based on "Google Profile", or "Returning Visitor", or "Browser type"?

EDIT: To clarify, I want to build custom segmentation components that appears into the side kick for the authors to simply drag and drop.

How do we go about creating these custom traits/filters?

davidx1
  • 3,525
  • 9
  • 38
  • 65
  • Have you tried this https://docs.adobe.com/docs/en/aem/6-1/administer/personalization/campaigns/segmentation.html – Suren Konathala Feb 22 '16 at 20:31
  • @SurendraKonathala yes I have. I'm interested in finding out how to build custom segments traits/component that shows up in the sidekick for the author to drag and drop. – davidx1 Feb 23 '16 at 00:39
  • Hi, you can create custom component with name say 'custom trait'. Provide component with properties sling:resourceSuperType="/libs/cq/personalization/components/traits" and give componentGroup="Segmentation". It will be shown in Sidekick on segment screen. In this component dialog, you can provide fields as name, operator and value and it will resolve segment accordingly. Let me know in case you are facing issues. – Manan Kapoor Feb 23 '16 at 13:49

1 Answers1

1

You need create component with below properties:

  • allowedParents : *
  • componentGroup : Segmentation
  • sling:resourceSuperType : /libs/cq/personalization/components/traits

In this component you can create similar dialog like in /libs/cq/personalization/components/traits/generic/dialog

And you can customize the list as per the requirement. You can handle the list of customized traits through listeners by reading from a json.

There on you can use the component while adding rules in segment.

I have done similar implementation let me know if you need any further help.

Harish Menda
  • 71
  • 1
  • 2
  • 13