CX Works

CX Works brings the most relevant leading practices to you.
It is a single portal of curated, field-tested and SAP-verified expertise for SAP Customer Experience solutions

Navigation
Last Updated: Jul 16, 2021

Send Out SAP Qualtrics Transactional Survey Links by SAP Marketing Cloud Campaign Execution (Part 2/2)

14 min read

SAP Marketing Cloud - Send Out SAP Qualtrics Transactional Survey Links by SAP Marketing Cloud Campaign Execution (Part 2/2)

Are you using SAP Marketing Cloud and Qualtrics in your organization? Would you like to combine the advantages of both solutions and receive even more personalized and document-related feedback? 

In this article, we focus on the integration between SAP Marketing Cloud and Qualtrics. The main goal of this integration concept was to use the E-mail Campaign execution of SAP Marketing Cloud for sending out transaction-based survey invitations provided by Qualtrics. In contrast the standard integration with SAP Marketing Cloud Release 2005 only allows survey send outs with anonymous links. This article will explain how the technical extension in SAP Marketing Cloud, Qualtrics, and SAP Integration Suite could look like.

Table of Contents

Technical Configuration and Basics

As lined out in Send Out SAP Qualtrics Transactional Survey Links by SAP Marketing Cloud Campaign Execution (Part 1/2), this scenario has the prerequisite of an already implemented standard survey integration between SAP Marketing Cloud and SAP Qualtrics. As soon as the standard integration is set up, we can start with the technical configuration for the Open Channel Integration and furthermore enhance the Qualtrics survey integration with SAP Marketing Cloud.
The following systems are involved in this custom integration process:

  • Qualtrics XM
  • SAP Integration Suite
  • SAP Marketing Cloud

In the following guide we will focus on the actions items for implementing this custom scenario in SAP Marketing Cloud, SAP Integration Suite and Qualtrics.

SAP Marketing Cloud

Custom Business Object

For having the survey metadata available in the Open Channel campaign action, we need to first store this data into a Custom Business Objects (CBO). Within this survey metadata CBO we save data like Survey ID and Name. Furthermore, we implemented one flag that indicates if the survey will be available for selection in the Open Channel Qualtrics Action.
To save the survey metadata we choose to create a CBO with the following fields:

  • Survey ID [Test with length 50]
  • Survey Name [Test with length 80]
  • Active [Checkbox]

To be able to enable or disable survey entries for the OC action, you can simply change the value for the field 'active' or you can implement a new action in the logic tab and name it “(de)activate”. 

SURVEY METADATA CBO - FIELDS

You can find a code example for the 'de(activation)' action below:

IF SURVEY_METADATA-active EQ ''.
	SURVEY_METADATA-active = 'X'.
ELSE.
	SURVEY_METADATA-active = ''.
ENDIF.

An example entry, which was manually created, could look as follows:

If you would like to have a more automatic process in place for synchronizing survey metadata between the two systems, you could simply accomplish this by a custom integration. Qualtrics provides webhook events for sharing survey metadata with external systems.

If you need more detailed information on how to create CBOs in SAP Marketing Cloud please refer to SAP Help.

Open Channel Campaign Action

To send the contact and transaction related data from the previously generated Target Group to Qualtrics, we need to first define an open channel action named, for example, 'Qualtrics'. In a next step, the business user will be able to select this action in the campaign automation flow together with the Target Group. The available survey drop-down values have been defined in the Survey Metadata CBO (see above) and only active surveys are visible in the drop-down list.

To have our custom action available in the campaign automation flow, there are three BAdIs which have to be implemented:

  1. (1) Open Channel: Define Implementations
  2. (2) Open Channel: Define Parameters for Implementation
  3. (4) Open Channel: Enhance Payload for Data Transfer

 The following code snippets are only examples which we implemented for our integration scenario.

(1) Open Channel: Define Implementations

In a first step we need to define the attributes like name and icon URL for the Qualtrics OC action. The following parameters are required.

(1) Open Channel - Define Action
APPEND VALUE #( implementation = 'ZOC_QUALTRICS'
                implementation_name = 'Qualtrics'
                icon_name = 'event'
                icon_url = 'http://go.sap.com/dam/application/shared/logos/sap-logo.png.adapt.72_36.false.png'
                communication_medium = 'SYSTEM' ) TO implementations.

(2) Open Channel: Define Parameters for Implementation

Define the attributes you want to have within your Qualtrics action. In our case we just need the ID and the Name of the Qualtrics survey, for which the personalized survey link should be created. First, we define the action attributes by giving the following information: action parameter, action parameter name, and action parameter type. In the next step we are selecting the survey metadata from the CBO 'YY1_SURVEY_METADATA'. These values are then assigned to the action parameter values and represent the information which is used to build the drop-down values for the action.

(2) Open Channel - Define Attributes
APPEND VALUE #( action_parameter = 'ZOC_Q_SURVEY'
                action_parameter_name = 'Qualtrics Survey'
                action_parameter_type = if_cuan_mkt_orch_constants=>action_param_type-string ) TO action_parameters.
 
"Dropdown Fields with Qualtrics Survey Names
SELECT * FROM YY1_SURVEY_METADATA
	INTO TABLE @DATA(lt_survey_metadata)
	WHERE active EQ 'X'.
 
LOOP AT lt_survey_metadata ASSIGNING FIELD-SYMBOL(<wa_survey_metadata>). 
	APPEND VALUE #( action_parameter = 'ZOC_Q_SURVEY'
 	    	        action_parameter_value = <wa_survey_metadata>-SURVEY_ID
  		            action_parameter_value_name = <wa_survey_metadata>-SURVEY_NAME ) TO action_parameter_values.
ENDLOOP.

(4) Open Channel: Enhance Payload for Data Transfer


During campaign execution the OC action collects all relevant contact and service order information from the export definition and merges them together in one payload for the outbound message. Furthermore, we add additional contact and service order attributes which are needed on Qualtrics. After processing all Target Group members together with their service orders, this payload is sent to SAP Integration Suite for further processing. 

(4) Open Channel – Enrich Payload with Contact Data
LOOP AT target_group_member_status ASSIGNING FIELD-SYMBOL(<wa_target_group_member_stat>).
 
* Survey ID & Outbound Interaction as Input Parameters
	APPEND VALUE #( attribute_id = 'ZOC_Q_SURVEY'
                    attribute_name = 'Qualtrics Survey'
                    attribute_type = 'Edm.String' ) TO target_group_member_attributes.
 
*   Qualtrics Survey Dropdown Field
	APPEND VALUE #( tg_member_key = <wa_target_group_member_stat>-tg_member_key
                    tg_member_interaction_contact = <wa_target_group_member_stat>-tg_member_interaction_contact
                    tg_member_interaction = <wa_target_group_member_stat>-tg_member_interaction
                    attribute_id = 'ZOC_Q_SURVEY'
                    attribute_value = <wa_header_attributes>-PARAM_VALUE ) TO target_group_member_data.
 
*   Add Data from IC_ROOT (Lastname, Firstname, E-Mail of Contact)
	CL_CUAN_INTERACT_CNTCT_HELPER=>get_contact_roots( EXPORTING IT_CONTACT_KEYS = value #( ( conv #( <wa_target_group_member_stat>-TG_MEMBER_INTERACTION_CONTACT ) ) )
                                                      IMPORTING ET_CONTACT_ROOT = data(lt_contact_root) ).
		READ TABLE lt_contact_root  ASSIGNING FIELD-SYMBOL(<wa_contact_root>) WITH KEY contact_key = <wa_target_group_member_stat>-tg_member_interaction_contact.
        	IF SY-SUBRC EQ 0.
            	"Last Name
                APPEND VALUE #( tg_member_key                 = <wa_target_group_member_stat>-tg_member_key
                                tg_member_interaction_contact = <wa_target_group_member_stat>-tg_member_interaction_contact
                                tg_member_interaction         = <wa_target_group_member_stat>-tg_member_interaction
                                attribute_id                  = 'NAME_LAST'
                                attribute_value               = <wa_contact_root>-name_last ) TO target_group_member_data.
                "E-Mail
                APPEND VALUE #( tg_member_key                 = <wa_target_group_member_stat>-tg_member_key
                                tg_member_interaction_contact = <wa_target_group_member_stat>-tg_member_interaction_contact
                                tg_member_interaction         = <wa_target_group_member_stat>-tg_member_interaction
                                attribute_id                  = 'SMTP_ADDR'
                                attribute_value               = <wa_contact_root>-smtp_addr ) TO target_group_member_data. 
 ENDLOOP.

For handling errors during the process, we are performing some data checks. For example, if the first or the last name is not maintained, we’ll create an error interaction with the interaction reason 'NAME_MISSING'.

(4) Open Channel – Error Handling
data:
    lv_error_reason type String.
 
constants:
    lc_ia_type_error type c length 20 value 'OUTBOUND_FAILED'.
 
LOOP AT target_group_member_status ASSIGNING FIELD-SYMBOL(<wa_target_group_member_stat>).
 
	" further Coding
 
	if <wa_contact_root>-name_last is initial.
    	lv_error_reason = 'NAME_MISSING'.
  	endif.
 
	if <wa_contact_root>-smtp_addr is initial.
    	lv_error_reason = 'EMAIL_MISSING'.
	endif.
 
	if lv_error_reason is not initial.
    	<wa_target_group_member_stat>-INTERACTION_TYPE = lc_ia_type_error.
    	<wa_target_group_member_stat>-FAILURE_REASON = lv_error_reason.
	endif.
 
ENDLOOP.

(5) Open Channel: Define Template for Outbound Interaction

Finally, a custom interaction of type 'Survey Distribution' is created for all target group members. This interaction is used for identifying which contacts were sent to Qualtrics for the survey distribution (see code snippet).

(5) Open Channel - Define Interaction
template-id_origin            = 'SAP_C4C_BUPA'. 
template-interaction_type     = 'SURVEY_DISTRIBUTION'. 
template-communication_medium = 'WEB'.

If you need more detailed information on how to implement Open Channel Integration in SAP Marketing Cloud please refer to SAP Help.

Open Channel Action in Campaign Modeler

After implementing all relevant Open Channel BAdIs, there will be a new custom action generated in the campaign 'Actions' tab with the defined name and image from BAdI (1) Open Channel: Define Implementations (see above).

The attributes, which are available in the detail view of the Qualtrics action, were defined in BAdI (2) Open Channel: Define Parameters for Implementation. In our case, we have defined a drop down list where we are able to select Qualtrics surveys by their name. The other two attributes 'Filter Conditions' and 'Export Definition' are part of the standard functionality.

In the BAdI (4) Open Channel: Enhance Payload for Data Transfer all relevant contact related master data is available by default. For adding to the transactional data, which is also needed in Qualtrics, we created an 'Export Definition'. These attributes refer to the segmented service orders from the target group (see screenshot). This information is later needed in Qualtrics for the survey flow and for the dashboard.

After the campaign has been successfully started and executed, the custom Open Channel interaction defined in BADI (5) Open Channel: Define Template for Outbound Interaction is created.

Now, all contacts together with their transactions have been transferred to Qualtrics. The generated survey links are stored in SAP Marketing Cloud as a custom interaction of the type  "Survey Link Created". This interaction is created as a follow-up interaction to the "Survey Distribution" interaction and is therefore also visible in the Open Channel campaign performance after it has been created.

For distributing the transactional based survey links to the target group members, a trigger-based campaign is used for sending out the personalized e-mails. This trigger-based campaign reacts on the "Survey Link Created" interaction, whenever such an interaction is saved in SAP Marketing Cloud.

Qualtrics

In Qualtrics there are no further extension tasks needed, we just have to make sure that the following objects are successfully created and available in Qualtrics. The following objects are required:

  • Survey
  • XM Contact Directory
  • Mailing List

First, we need an activated survey in Qualtrics with all required 'Embedded Data' fields implemented. Furthermore, the XM Contact Directory for storing contact information should be available as well and made accessible via API calls. Finally, a mailing list is needed for creating transactional distribution links for a specific survey.

The required configuration steps can be found in the SAP Marketing Cloud standard integration guide.


SAP Integration Suite

Like the standard integration scenario, we are using the Cloud Integration capability within SAP Integration Suite as middleware for integrating Qualtrics and SAP Marketing for our custom process. In addition to the pre-delivered IFlows within the standard package we need to create two more custom IFlows. These two IFlows have a parent-child relationship with different responsibilities, where the parent IFlow receives the call from SAP Marketing in the first place and routes it asynchronously to the child IFlow. This is necessary for the Open Channel outbound interaction ‘Survey Distribution’ being created in SAP Marketing as soon as SAP Integration Suite receives the call. Otherwise we would not be able to create a follow up interaction based on this Open Channel outbound interaction. The asynchronous call is implemented by a SOAP call with the message protocol SOAP 1.x.

The second IFlow (see screenshot below) is responsible for creating or updating all required objects in Qualtrics and returning the transactional survey link personalized for each customer.

The first task is to create or update contact and transaction information in Qualtrics XM Contact Directory, so that all contacts with their specific transaction (in our case ‘Service Orders’) from the Target Group Member List in Marketing are available in Qualtrics.

If you need more detailed information on how to create

In a second step, we create a "transaction batch" for this survey, which includes all previously created transactions.

If you need more detailed information on how to create a transaction batch in Qualtrics, refer to Qualtrics API References.

Afterwards, we can start the creation of the transactional distribution links by an API call.

If you need more detailed information on how to create a custom distribution list in Qualtrics, refer to Qualtrics API References.

In a last step, we are retrieving the survey links and send them to SAP Marketing by creating an interaction with the custom type ‘Survey Link Created’. SAP Marketing receives these interactions and starts the personalized survey send out with a trigger-based E-Mail campaign, in which the transactional survey link is included. Finally, the standard integration takes care of sending the survey responses to SAP Marketing where further ‘Close The Loop’ processes based on specific responses could be implemented (for example, creating follow-up Activities in Sales Cloud or Service Cloud).

Conclusion

This scenario showcases how you can enrich existing business processes by sending out personalized Qualtrics Surveys with SAP Marketing Cloud, based on Target Groups with reference to specific transactions. This implementation is based on standard Qualtrics – SAP Marketing integration and makes use of the Open Channel Extensibility function.

The articles below will help you dive deeper on Standard Integration between SAP Marketing Cloud and Qualtrics:


Overlay