cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Integration of SAP Marketing Cloud Product Recommendations in SAP Commerce

torsten-mittag
Explorer
0 Likes
639

Hi,

I'm trying to integrate the product recommendations into the SAP Commerce system and need some help.

Some basic informations before:

  • We are using SAP Commerce 6.7
  • I have successfully integrated the synchronization of product data (and other data) via the Expressway Integration
  • I have successfully integrated clickstream data upload to the SAP Marketing Cloud

For the synchronization of products we use the product codes, we got from our customers external service, a 18-digit unique number. This process works fine, product codes in SAP Marketing Cloud and Commerce are equal (as far as i can see them on the product view in the Marketing Cloud).

What I have done till now:

1. I followed the instructions of setting up the recommendation component like Configuring Recommandation Components

The Problem: After installing the addOn and following the configuration steps to our custom storefront extension, there was no data of recommended products.

So I startet to analyze the source code of the sapymktrecommendation extensions and found the

com.hybris.ymkt.recommendation.services.RecommendationService. This service is basically used to request recommendations from SAP Marketing Cloud system.

2. I wrote a custom test controller using the RecommendationService to get recommendations.

I created a RecommendationContext with the data I got from Marketing Cloud (Recommandation View) and the created component of step 1.

The request method I wrote

    @RequestMapping(value = "prod", method = RequestMethod.GET)
    public ResponseEntity<String> testProductRecos() {

        final RecommendationContext context = new RecommendationContext();

        context.setLeadingProductId(null);
        context.setScenarioId("SAP_TOP_SELLER_HOME_PAGE");
        context.setIncludeCart(true);
        context.setIncludeRecent(true);
        context.setLeadingItemDSType("SAP_HYBRIS_PRODUCT");
        context.setLeadingItemType("G");
        context.setCartItemDSType("SAP_HYBRIS_PRODUCT");

        final List<ProductRecommendationData> productRecommendations = recommendationService
                .getProductRecommendation(context);

        final String productCodes = productRecommendations.stream.map(ProductRecommendationData::getProductCode)
                .collect(Collectors.joining(", "));

        return new ResponseEntity<String>(productCodes, HttpStatus.I_AM_A_TEAPOT);
    }

As response I got a list of for me unidentifiable hexadecimal codes, e.g.:

6104013083D752AA16003BFA5CF0E45B, 7FF0003083D752AA16003BFA5CF0E45B, 6BDC003083D752AA16003BFA5CF0E45B, 980B013083D752AA16003BFA5CF0E45B, 238C0020FDE7F0C016003BFA9DADCD04, FD380C009B58078D16003BFA0129F0D1, 2FB70470051D9DB316003BFA61D0ED58

I tried different parameters in the context creation, but the results were everytime the same.

So my questions are:

  • What are these codes?
  • If this are product codes (may a internal code of SAP Marketing Cloud), how can I get the correct product codes, we submitted via product synchronization
  • Or, did I something wrong in my integration process?

I hope, I collected all necessary data for my problem.

Thanks in advance & best regards

Torsten Mittag

Accepted Solutions (1)

Accepted Solutions (1)

sandeepmkh
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Torsten Mittag,

You have to define a Recommendation model type with a right source (product Origin ID) from where the products should be retrieved.

e.g SAP Commerce product - if you are getting the product from SAPCommerece.

Use the app : Recommendation model type to define a new source (Recommendation Type:)

Regards,

Sandeep Kulkarni

Answers (1)

Answers (1)

torsten-mittag
Explorer
0 Likes

Hi Sandeep Kulkarni,

thanks.

This solved the problem, now I get the correct product codes.