Integrating Advisor Campaigns

These are campaigns for which the flavour attribute is set to ADVISOR. Advisor campaigns contain two new sections in their response. The first section contains the active questions and associated answers. The second section contains the complete question and answer tree. The active questions are those that are currently to be displayed to the shop visitor. Since the campaign consists of a tree or hierarchy of questions and answers, initially the “active” questions section consists of the first question in the tree. When the user clicks a response, the follow-up questions below the selected answer are returned as active questions.

XML

<ff xsi:noNamespaceSchemaLocation="schema/7.2/ffresult.xsd">
  ...
  <campaigns>
    ...
    <campaign nr="1" name="Bike-Advisor" category="Advisors" flavour="ADVISOR">
      <target>
        <name></name>
        <destination></destination>
      </target>
      <pushedProducts count="0"></pushedProducts>
      <advisor>
        <activeQuestions>
          <question id="0">
            <text>Welcher Fahrrad-Typ sind Sie?</text>
            <answer id="1">
              <text>Racing</text>
              <params>...</params>
            </answer>
            <answer id="2">
              <text>MTB</text>
              <params>...</params>
            </answer>
            ...
          </question>
        </activeQuestions>
        <advisorTree>
          <question id="0">
            <text>Welcher Fahrrad-Typ sind Sie?</text>
            <answer id="1">
              <text>Racing</text>
              <params>...</params>
            </answer>
            <answer id="2">
              <text>MTB</text>
              <params>...</params>
 
              <question id="3">
                <text>Hardtail or Dirt?</text>
                <answer id="4">
                  <text>Hardtail</text>
                  <params>...</params>
                </answer>
                <answer id="5">
                  <text>Dirt</text>
                  <params>...</params>
                </answer>
              </question>
            </answer>
            <answer id="6">
              <text>BMX</text>
              <params>...</params>
            </answer>
          </question>
        </advisorTree>
      </advisor>
    </campaign>
  </campaigns>
  ...
</ff>

JSON

{"searchResult": {
    
    "campaigns": [
      {
        "activeQuestions": [
          {
            "answers": [
              {
                "id": "1",
                "params": { ... },
                "questions": [ ],
                "text": "Racing"
              },
              {
                "id": "2",
                "params": { ... },
                "questions": [ ],
                "text": "Racing"
              },
             
            ],
            "id": "0",
            "text": "Welcher Fahrrad-Typ sind Sie?"
            "visible": true
          }
        ],
        "advisorTree": [
          {
            "answers": [
              {
                "id": "1",
                "params": { ... },
                "questions": [ ],
                "text": "Racing"
              },
              {
                "id": "2",
                "params": { ... },
                "questions": [
                  {
                    "answers: [
                      {
                        "id": "4",
                        "params": { ... },
                        "questions": [ ],
                        "text": "Hardtail"
                      },
                      {   
                        "id": "5",
                        "params": { ... },
                        "questions": [ ],
                        "text": "Dirt"
                       },
                     ],
                     "id": "3",
                     "text": "Hardtail or Dirt?"
                     "visible": true
                   }
                 ],
                 "text": "MTB"
               },
               {
                 "id": "6",
                 "params": { ... },
                 "questions": [ ],
                 "text": "BMX"
               }
             ],
             "id": "0",
             "text": Welcher Fahrrad-Typ sind Sie?"
             "visible": true
           } 
         ],
         "category": "Advisors",
         "feedbackTexts": [ ],
         "flavour": "Advisor",
         "id": "2",
         "name": "Bike-Advisor",
         "pushedProductsRecords": [ ],
         "target": {
         "destination": "",
         "name": ""
       }
     }
   ],
 }
 
}

Webservice / SOAP

class Campaign {   
   ...   
   List<Question>         activeQuestions;
   List<Question>         advisorTree; 
}
class Question {
   String          id;
   String          text;
   List<Answer>      answers;
   boolean          isVisible;
}
class Answer {
   String          id;
   String          text;
   Params          params;
   List<Question>    questions;
}
Please note, that the parameter generateAdvisorTree has no effect and only exists for compatibility reasons. The advisor tree originally generated through the parameter is now always created and delivered with the search result (provided an advisor campaign is active).


Page Contents