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

Integrating SAP Marketing Cloud and SAP Commerce Cloud Using SAP Integration Suite

13 min read

Integrating SAP Marketing Cloud and SAP Commerce Cloud using SAP Integration Suite

SAP Marketing Cloud and SAP Commerce Cloud are two products within the SAP Customer Experience solutions portfolio. Each come with their own set of functionality and data. Although powerful on their own, by integrating them you can unlock additional power to better elevate your overall customer experience. There are many different options for integrating these two products. This article will focus on integration using the Cloud Integration capability within SAP Integration Suite and SAP Commerce Cloud to help you perform this integration and speed up your development.

You must be on SAP Commerce core version 1905 or higher. If you're on a version lower than this we recommend that you read through the article Integrating SAP Marketing Cloud and SAP Commerce Cloud.

Table of Contents

Background

The integration with Marketing Cloud will be dependent on which SAP Commerce solution you're using:

Architectural Overview

The following diagram shows the main components of this integration. In this diagram, SAP Commerce Cloud will send the master data to Cloud Integration, which will transform the data received and send to SAP Marketing Cloud. Depending on your version of SAP Commerce core the main extensions in SAP Commerce Cloud are part of the SAP Commerce Cloud Integration Extension Pack or the CEP, as well as sapymktdatareplication.

In Cloud Integration you will need to use the package SAP Commerce Cloud Integration with SAP Marketing Cloud (as well as SAP Commerce Integration with SAP Marketing Cloud APIs if on-prem or SAP Commerce Cloud on SAP Infrastructure), which have the iFlows to transform the data from SAP Commerce Cloud and send to SAP Marketing Cloud. In SAP Marketing Cloud you will need to have enabled the flows exposing the odata interfaces to consume the data sent from Cloud Integration.

Installation

In this section we will cover the installation needed for SAP Commerce Cloud. For the others components no installation is needed–only configurations needs to be applied and will be covered by the following Configuration section.

SAP Commerce Cloud

First, you must configure your manifest.json to build and deploy. You need to make sure that the patch level is not configured to the commerceSuiteVersion property.

{
    "commerceSuiteVersion": "2005",
}

If you're using Commerce Cloud with Commerce core 1905 you'll need to enable Cloud Extension Pack:

{
    "commerceSuiteVersion": "1905",
    "useCloudExtensionPack": true,
}


You must also configure the right extensions to be built. If your manifest file is not configured for SAP Configuration Reuse, then you will need to add the following extensions in your manifest.json file:

manifest.json
"extensions": [
    ...
    "outboundservices",
    "outboundsync",
    "odata2webservices",
    "integrationbackoffice",
    "integrationmonitoringbackoffice",
    "outboundsyncbackoffice",

    "sapcpiadapter",
    "sapcpicustomerexchange",
    "sapcpiorderexchange",
    "sapcpiproductexchange",

    "personalizationymkt",
    "sapymktclickstream",
    "sapymktcommon",
    "sapymktconsent",
    "sapymktdatareplication",
    "sapymktrecommendation",
    "sapymktrecommendationaddon",
    "sapymktrecommendationbuffer",
    "sapymktrecommendationwebservices",
    "sapymktsegmentation",
    "sapymktsegmentationwebservices"
    ...
]

If you are using SAP Configuration Reuse, make sure the extensions above are included in your localextensions.xml (see local installation section below). The extensions must be declared first in your localextensions.xml.

If you are using B2B extensions, consider to use these extensions too:

    "sapcpicustomerexchangeb2b",
    "sapcpiorderexchangeb2b", 
    "sapymktsegmentationb2b"

The extension sapymktsync is deprecated, so if you have it on your manifest.json or localextension.xml file it is necessary to remove it.

After you have made the changes above, commit the files in your code repository and use Cloud Portal to create your build. The build time may vary from configuration to configuration.  When it's ready, you need to deploy your build. Select your build and click on the "Deploy to Environment" button. Select the target environment and select the option "Update database" for the Database Action;

Configuring

At this point SAP Marketing Cloud and Cloud Integration need to be configured to accept and/or transform the data. This section covers the configurations needed for integrating Marketing Cloud, Cloud Integration and SAP Commerce Cloud.

SAP Marketing Cloud

In SAP Marketing Cloud, you need to publish the standard application programming interface (APIs) by Communication Management application.  The communication management applications allow you to establish secure communication between SAP Marketing Cloud and other systems.


The best practice to organize efficient data exchange is covered in the Communication Management documentation.

In general, the steps to allow other systems to use Marketing APIs are: 


For SAP Commerce Cloud integration, you need to setup the following communication arrangements scenarios, as needed. 

Communication Arrangement Data Replication Scenario
SAP_COM_0207 Customer and consent
SAP_COM_0082 Order, return request and saved cart
SAP_COM_0206 Abandoned shopping cart and product review
SAP_COM_0171 Product
SAP_COM_0172 Product category


After communication arrangement activation, you'll be able to use SAP Marketing Cloud APIs. You can find API URL via the Inbound Services list.


SAP Integration Suite

In Cloud Integration, there is a pre-packaged standard content provided by SAP to speed up integration implementation projects between SAP Commerce Cloud and SAP Marketing Cloud.  

In Cloud Integration, you need to find "SAP Commerce Cloud Integration with SAP SAP Marketing Cloud" package through Discover (option to find content packages).



Select the package, then copy it in your Cloud Integration tenant. 



By Design (option to work with content packages), choose the Integration IFlow that you want to use, then you just need to "Configure" 


You can find the step by step Cloud Integration setup in our Configuring SAP Cloud Platform Integration guide (1905) or Configuring SAP Cloud Platform Integration (2005).

If you're running an on-prem version of SAP Commerce or SAP Commerce on SAP Infrastructure you should also repeat the steps above with the SAP Commerce Integration with SAP Marketing Cloud APIs

SAP Commerce Cloud

After you build and deploy your SAP Commerce Cloud in any environment, you will need to create an ImpEx file with the endpoints that you want to use and replace the placeholder {CPITenanturl} and the adjusts your credentials to access your Cloud Integration tenant.

You can find the impex files at the extension sapymktdatareplication.

Depending on the data you wish to replicate, you need to choose what impex file to use. The list of impex files with endpoints to be changed include:

  • projectdata-MKTOutboundAbandonedCart.impex
  • projectdata-MKTOutboundConsent.impex
  • projectdata-MKTOutboundCustomer.impex
  • projectdata-MKTOutboundOrder.impex
  • projectdata-MKTOutboundProduct.impex
  • projectdata-MKTOutboundProductCategory.impex
  • projectdata-MKTOutboundProductReview.impex
  • projectdata-MKTOutboundReturnRequest.impex
  • projectdata-MKTOutboundSavedCart.impex


The following is an example of endpoint configuration for customer data replication:

###############################################################
# This sets up the endpoint called "mktCPICustomerEndpoint."
# #############################################################
INSERT_UPDATE Endpoint ; id[unique = true]      ; version[unique = true] ; name                   ; specUrl                                                                                                       
                       ; mktCPICustomerEndpoint ; unknown                ; mktCPICustomerEndpoint ; "{CPITenanturl}/gw/odata/SAP/REPLICATE-CUSTOMER-FROM-SAP-COMMERCE-CLOUD-TO-SAP-MARKETING-CLOUD;v=1/$metadata" 
                       
##############################################################
# This sets up a ConsumedDestination called "mktCPICustomerDestination."
# It uses the Endpoint and BasicCredential created above. The user calls
# the Outbound Service with the destination ID (e.g. "mktCPICustomerDestination").
# The Outbound Service looks up the details of the destination by ID,
# so it knows where to send the data
# ############################################################
INSERT_UPDATE DestinationTarget ; id[unique = true]               
                                ; mktCPICustomerDestinationTarget 
                                
INSERT_UPDATE ConsumedDestination ; id[unique = true]         ; url                                                                                                           ; endpoint(id, version)          ; credential(id)         ; destinationTarget(id)[default = mktCPICustomerDestinationTarget] ; additionalProperties(key, value)[map-delimiter=|]                                                            
                                  ; mktCPICustomerDestination ; "{CPITenanturl}/gw/odata/SAP/REPLICATE-CUSTOMER-FROM-SAP-COMMERCE-CLOUD-TO-SAP-MARKETING-CLOUD;v=1/Customers" ; mktCPICustomerEndpoint:unknown ; mktCPIBasicCredentails ;                                                                  ; "csrfURL->{CPITenanturl}/gw/odata/SAP/REPLICATE-CUSTOMER-FROM-SAP-COMMERCE-CLOUD-TO-SAP-MARKETING-CLOUD;v=1" 
                                  

At the time of writing this article there is no property that could be used to configure the {CPITenanturl}–you will need to change it for each environment that you have using Impex files.

The out of the box configuration comes with basic credentials authentication method, and you can change it for OAuth or Certificate. For more details please check the Credential Configuration page in the product documentation.

You can also extends your configuration to include more fields to replicate from SAP Commerce Cloud to Cloud Integration, you can also find some examples at the extension sapymktdatareplication.

List of impex files with fields and types definition:

  • essentialdata-MKTOutboundAbandonedCart.impex
  • essentialdata-MKTOutboundConsent.impex
  • essentialdata-MKTOutboundCustomer.impex
  • essentialdata-MKTOutboundOrder.impex
  • essentialdata-MKTOutboundProduct.impex
  • essentialdata-MKTOutboundProductCategory.impex
  • essentialdata-MKTOutboundProductReview.impex
  • essentialdata-MKTOutboundReturnRequest.impex
  • essentialdata-MKTOutboundSavedCart.impex


Remember if you remove or add any type or field those changes must also be changed at Cloud Integration and SAP Marketing Cloud


Finally, you need to configure your cron jobs to replicate data that you need. To do so, check Configuring Integration API Cron Jobs documentation for more details.

List of data replication cronjobs:

  • mktCPICustomerOutboundSyncCronJob for customer data replication
  • mktCPIOrderOutboundSyncCronJob for order replication
  • mktCPIAbandonedCartOutboundSyncCronJob for abandoned cart data replication
  • mktCPIProductOutboundSyncCronJob for product replication
  • mktCPIProductCategoryOutboundSyncCronJob for product category replication (a prerequisite for product replication)
  • mktCPIConsentOutboundSyncCronJob for consent data replication
  • mktCPIProductReviewOutboundSyncCronJob for product review data replication
  • mktCPIReturnRequestOutboundSyncCronJob for return request data replication
  • mktCPISavedCartOutboundSyncCronJob for saved cart data replication


Depending on the volume of data that you are planning to have for each data replication, consider to schedule your cron jobs in small intervals (e.g. 5min or 15min) to reduce your outbound payload, you should also to take in account what you are going do with this data on MC, sometimes you also can plan and schedule your jobs to run out of commercial hours daily.


Troubleshooting

In this example, the system will send data from SAP Commerce Cloud to Cloud Integration (and then to SAP Marketing Cloud) after the creation of a user on the storefront.

So, create a user and execute the CronJob mktCPIoDataCustomerOutboundSyncJob as the image below.

This will generate some lines in your SCM log as follow:

INFO  [hybrisHTTP36] [PerformCronJobAction] Performing CronJob OutboundSyncCronJobModel (8796117074421@44) from Backoffice!
INFO  [mktCPICustomerOutboundSyncCronJob::de.hybris.platform.outboundsync.jalo.OutboundSyncJob] (mktCPICustomerOutboundSyncCronJob) [InMemoryChangesCollector] Collecting changes has been finished - 1 changes collected
INFO  [mktCPICustomerOutboundSyncCronJob::de.hybris.platform.outboundsync.jalo.OutboundSyncJob] (mktCPICustomerOutboundSyncCronJob) [InMemoryChangesCollector] Collecting changes has been finished - 0 changes collected


And you can see the result on Cloud Integration at Monitor Message Processing > All Integration Flows (Past Hour) one occurrence.


Click a drop down you will be able to see the status and other details.


In SAP Marketing Cloud you can check if your contact data has arrived at browse contact origin


Conclusion

You should now understand how to quickly integrate SAP Commerce Cloud in the Public Cloud with SAP Marketing Cloud using the standard packages. With minimal configurations you can unlock the power of integrating SAP Commerce Cloud and SAP Marketing Cloud.

The list bellow summarise the steps which you need to do to integration SAP Commerce Cloud and SAP Marketing Cloud:

  • Configure SAP Marketing Cloud to expose inbound services
  • Configure SAP Integration Suite and deploy your flows
  • Install and configure SAP Commerce Cloud
  • Utilize your successful integration
Overlay