/
NUTRINTG Middleware basic configuration

NUTRINTG Middleware basic configuration

Approved by:

@Kamil Debski (Unlicensed)
@Jan Jastrzab
@Tristan Szaniawski (Unlicensed)
@Robert Radzimowski

 

  1. Add new Shopify shop integration to CDS or CDP

  • adding each shop requires separate configuration for order and customer data

CUSTOMERS

Step to perform:

  1. For CDP integration → request to CDP for creating the set of metadata for customers

  2. For CDS integration → Create a bucket with integration-tool

    1. Fill bucket data with relevant data (JSON part may be filled with empty JSON => { } )

    2. Generate a new schema name and schema (keep “Require at least 1 agreement” as marked)

    3. Delete generated schema from “type” value (row 6 all the way down):

      1.  

    4. Paste the JSON from the file “CDS_order_schema_forTool” below right under the “title”

    5. Go to Integration rule section, and paste the attached integration rule

      1. This is a standard integration rule for the customer, however, make sure that values are in line with the columns in the SFMC DE

    6. Create a bucket (schema, bucket, add brands, integration rule)

  3. Configure Middleware by executing relevant INSERTS

    1. configure CUSTOMER SERVICE

      1. Change the query:

        1. _id = shop domain

        2. hmacKey = encrypted HMAC (received from Shopify). Notice encryption differs between services and environment

        3. subscriptionId = in case of integration with CDP value should be received from Epsilon, in case of integration with CDS, the value should be unique

        4. Agreements should be changed accordingly to business needs

        5. An example query to execute:

          db.getCollection('cdpShopifyCustomerService_shopifyDomains').insert({ "_id" : "enfashop-es-dev.myshopify.com/", "hmacKey" : "Us9N6pIJ7yvBe9tU52sTxuABvGm3bGiESE+BwzVyqvdKsVrVJMQDDMr7LBXm7QYyiPIE2Vc3qI6g/r2LePwrMlg3KXo8JYdfJNCICY33ll4=", "brandOrgCode" : "MJNESP", "dataSourceCode" : "ESPENMESSHPF", "accountSource" : "ESPENMECOMCUST", "tierCode" : "MJNESPTIER1", "subscriptionId" : "83eabb31-c1f6-4fe6-a743-7293c7503a39", "countryCode" : "ESP", "agreements" : [ { "BusinessId" : "LT-CP-GB-en-Veet-d_to_c", "RevisionId" : "5eeb1eb5263d2300011dc809", "CustomName" : "Cookie Policy", "ConsentAcceptedInd" : true, "ConsentDesc" : "", "MandatoryInd" : true }, { "BusinessId" : "LT-PP-GB-en-Veet-d_to_c", "RevisionId" : "5eeb1eac50b1830001e8c5e9", "CustomName" : "Privacy Policy", "ConsentAcceptedInd" : true, "ConsentDesc" : "", "MandatoryInd" : true }, { "BusinessId" : "LT-TC-GB-en-Veet-d_to_c", "RevisionId" : "5eeb1ea450b1830001e8c5e6", "CustomName" : "Terms and Conditions", "ConsentAcceptedInd" : true, "ConsentDesc" : "", "MandatoryInd" : true } ] })
    2. configure ROUTER

      1. possible queues:

        1. PROD:

          1. middleware-message-cds-queue

          2. middleware-profile-message-cdp-queue

        2. STAGE:

          1. middleware-message-cds-queue-stage

          2. middleware-profile-message-cdp-queue-stage

      2. An example query to execute:

        db.getCollection('middlewareMessageRouter_accountSourceToSinkMapping').insert({ "accountSource" : "VNMDURCHEETAH0001", "sink" : "middleware-message-cds-queue" })
    3. configure CDS ADAPTER (in case of CDS integration, for CDP step is not required)

      1. Change the query according to the created bucket and account source code

      2. An example query to execute:

        db.getCollection('cdsMiddlewareMessageAdapter_accountSourceToBucketMapping').insert({ "accountSource" : "VNMDURCHEETAH0001", "bucketData" : { "bucketId" : "5f212b342a49ee0001e746a7", "url" : "https://www.durexvietnam.vn/", "brand" : "Durex", "market" : "VN-vi" } })

ORDERS

Step to perform:

  1. For CDP integration → request to CDP for creating the set of metadata for customers

  2. For CDS integration → Create a bucket with integration-tool

    1. Fill bucket data with relevant data (JSON part may be filled with empty JSON => { } )

    2. Generate a new schema name and schema (keep “Require at least 1 agreement” as unmarked)

    3. Delete generated schema from “type” value (row 6 all the way down):

      1.  

    4. Paste the JSON from the file “CDS_order_schema_forTool” below right under the “title”

    5.  

    6. Go to Integration rule section:

      1. There are two DE in SFMC for orders → Orders and Line_items. As a result, we need to add two integration rule to one bucket

      2. Copy integration rule from the file, which is relevant to the DE key inserted in the first view of the integration-tool. (example: you pasted DE key for line_items DE, you should paste integration rule from the file OrderLineItemsIntegrationRule)

    7. Execute (create schema, create bucket, add brands, add integration rule)

    8. Go back to the first view and change DE key for purposes of creating second integration rule

    9. Do not change the schema, go to Integration rule section and paste second integration rule

    10. Execute (add integration rule)

  3. Configure Middleware by executing relevant INSERTS

  • ORDER for CDP

  1. cdpShopifyOrderService_shopifyDomains

    SHOP_DOMAIN - the Shopify shop domain, the same as for cdpShopifyCustomerService_shopifyDomains
    ORDER_ACCOUNT_SOURCE - Account Source of Order
    CUSTOMER_ACCOUNT_SOURCE - Account Source of Customer correlated with Order

  2. cdpShopifyOrderAdapter_shopifyDomains

    SHOP_DOMAIN - the Shopify shop domain, the same as for cdpShopifyOrderService_shopifyDomains
    CUSTOMER_ACCOUNT_SOURCE - the same as for cdpShopifyOrderService_shopifyDomains

  3. middlewareMessageRouter_accountSourceToSinkMapping

    ORDER_ACCOUNT_SOURCE - the same as for cdpShopifyOrderService_shopifyDomains
    SHOPIFY_ORDER_ADAPTER_QUEUE - the queue name bound to shopify-order-adapter
    QUEUE_OR_EXCHANGE_WITH_IMS - the name of the IMS queue or exchange with IMS queue is bound to

  4. middlewareProfileSearchService_accountSourceToDestinationMapping

    ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration

  5. middlewareInstantMessageService

    ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
    API_EVENT - the API-event of order Journey for a given market
    DATA_EXTENSION_KEY - the key of SFMC DE for order line items for a given market

  6. cdpSfmcJourneyService_tokenConfig

    API_EVENT - the API-event of Journey - the same as for middlewareInstantMessageService
    DATA_EXTENSION_KEY - the key of SFMC DE, the same as for middlewareInstantMessageService

  • Order for CDS

  1. cdpShopifyOrderService_shopifyDomains

    SHOP_DOMAIN - the Shopify shop domain
    ORDER_ACCOUNT_SOURCE - Account Source of Order
    CUSTOMER_ACCOUNT_SOURCE - account source of profiles correlated with Orders. OPTIONAL, could be used in the future, but if there is no Account Source, it can be skipped

  2. cdsMiddlewareMessageAdapter_accountSourceToBucketMapping

    ACCOUNT_SOURCE - the same as for cdpShopifyOrderService_shopifyDomains configuration (if exists) or the same which will be included in HTTP request header for cdp-profile-service
    BUCKET_ID - created bucket in CDS beforehand, with Profile schema
    BRAND - brand for the given bucket
    MARKET - market for the given bucket
    CDS_TARGET - target CDS instance (EU or RUSSIAN)

  3. middlewareMessageRouter_accountSourceToSinkMapping

    ORDER_ACCOUNT_SOURCE - the same as for cdpShopifyOrderService_shopifyDomains
    CDS_ADAPTER_QUEUE - the queue name bound to shopify-order-adapter
    QUEUE_OR_EXCHANGE_WITH_IMS - the name of the IMS queue or exchange with IMS queue is bound to

  4. middlewareInstantMessageService

    ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
    API_EVENT - the API-event of order Journey for a given market
    DATA_EXTENSION_KEY - the key of SFMC DE for order line items for a given market

  5. cdpSfmcJourneyService_tokenConfig

    API_EVENT - the API-event of Journey - the same as for middlewareInstantMessageService
    DATA_EXTENSION_KEY - the key of SFMC DE, the same as for middlewareInstantMessageService

 

  1. configure ROUTER

    1. possible queues:

      1. PROD:

        1. middleware-message-cds-queue

        2. middleware-order-message-cdp-queue

      2. STAGE:

        1. middleware-message-cds-queue-stage

        2. middleware-order-message-cdp-queue-stage

    2. example query:

  2. configure CDS ADAPTER (in case of CDS integration)

    1. Make sure to add “/{orderId}” at the end of the “url”

    2. example query:

  3. configure CDP ADAPTER

    1. Do not change “filesConfig” part of the query

    2. example query:

 

2. Configure campaign via Profile Service (used by Husky and BARF app from Shopify team)

Profile for CDP

  1. (Optional - only when profile comes from Shopify) cdpShopifyCustomerService_shopifyDomains

  2. middlewareMessageRouter_accountSourceToSinkMapping

    ACCOUNT_SOURCE - the same as for cdpShopifyCustomerService_shopifyDomains configuration (if exists) or the same which will be included in HTTP request header for cdp-profile-service
    CDP_PROFILE_QUEUE - the queue name bound to cdp-profile-adapter
    QUEUE_OR_EXCHANGE_WITH_IMS - the name of the IMS queue or exchange with IMS queue is bound to

  3. middlewareProfileSearchService_accountSourceToDestinationMapping

    ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration

  4. middlewareInstantMessageService

    ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
    API_EVENT - the API-event of customer Journey for a given market

  5. cdpSfmcJourneyService_tokenConfig

    API_EVENT - the API-event of Journey - the same as for middlewareInstantMessageService

Profile for CDS

  1. (Optional - only when profile comes from Shopify) cdpShopifyCustomerService_shopifyDomains

  2. middlewareMessageRouter_accountSourceToSinkMapping

    ACCOUNT_SOURCE - the same as for cdpShopifyCustomerService_shopifyDomains configuration (if exists) or the same which will be included in HTTP request header for cdp-profile-service
    CDS_ADAPTER_QUEUE - the queue name bound to cds-adapter
    QUEUE_OR_EXCHANGE_WITH_IMS - the name of the IMS queue or exchange with IMS queue is bound to

  3. cdsMiddlewareMessageAdapter_accountSourceToBucketMapping

    ACCOUNT_SOURCE - the same as for cdpShopifyCustomerService_shopifyDomains configuration (if exists) or the same which will be included in HTTP request header for cdp-profile-service
    BUCKET_ID - created bucket in CDS beforehand, with Profile schema
    BRAND - brand for the given bucket
    MARKET - market for the given bucket
    CDS_TARGET - target CDS instance (EU or RUSSIAN)

  4. middlewareInstantMessageService

    ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
    API_EVENT - the API-event of customer Journey for a given market

  5. cdpSfmcJourneyService_tokenConfig

    API_EVENT - the API-event of Journey - the same as for middlewareInstantMessageService

Step to perform:

  1. For CDP integration → request to CDP for creating the set of metadata for customers

  2. For CDS integration → Create a bucket with integration-tool

    1. Fill bucket data with relevant data (JSON part may be filled with empty JSON => { } )

    2. Generate a new schema name and schema (keep “Require at least 1 agreement” as marked)

    3. Delete generated schema from “type” value (row 6 all the way down):

      1.  

    4. Paste the JSON from the file “CDS_order_schema_forTool” below right under the “title”

    5. Create relevant for the campaign integration rule, a recommended tool for creating new integration rules → http://jolt-demo.appspot.com/#inception

      1. As a source JSON paste a datarow from CDS. Keep in mind that integration rules in CDS need additional node in JSON → “master”. So for purpose of jolt-demo.appsot.com add “master” node to the source JSON, example:

      2.  

      3. example integration rule to be pasted into the integration-tool:

f. Create a bucket (schema, bucket, add brands, integration rule)

  1. Configure Middleware by executing relevant INSERTS

    1. configure ROUTER

      1. possible queues:

        1. PROD:

          1. middleware-message-cds-queue

          2. middleware-profile-message-cdp-queue

          3. middleware-profile-message-cds-fulfillment-exchange

          4. middleware-profile-message-cdp-fulfillment-exchange

          5. middleware-profile-message-cdp-qeepsake-fulfillment-exchange

        2. STAGE:

          1. middleware-message-cds-queue-stage

          2. middleware-profile-message-cdp-queue-stage

          3. middleware-profile-message-cds-fulfillment-exchange-stage

          4. middleware-profile-message-cdp-fulfillment-exchange-stage

          5. middleware-profile-message-cdp-qeepsake-fulfillment-exchange-stage

      2. An example query to execute:

    2. configure CDS ADAPTER (in case of CDS integration, for CDP step is not required)

      1. Change the query according to the created bucket and account source code

      2. An example query to execute:

 

3. Configure WayIn campaign

Steps to perform:

  1. Execute steps from the section “configure new campaign via Profile Service”

  2. Add addition configuration in MongoDB. Change below example requests according to the needs and execute:

    1. _id = account source

    2. acceptLanguage = accept language

    3. brandOrgCode = brand org code

    4. programCode = program code

    5. sourceCode = source code

    6. tierCode = tier code

    7. subscriptionChannelCode = subscription channel code

    8. subscriptionId = subscription id

4. Configure Abandoned Checkout service (deprecated)

Steps to perform:

  1. Keep in mind that “shopifyToken” is “{API_KEY}:Password” encoded in BASE64 and encoded with MongoDB encryption relevant for the environment and service

    1. example:

      1. Shopify team create an app to allow Middleware to send the request to the shop

      2. The app has API KEY = “aaa” and password = “xxx”

      3. We need to encode “aaa:xxx” in base64 to receive encoded value “YWFhOnh4eA==”

      4. encrypt “YWFhOnh4eA==” with relevant mongo DB encryption key

  2. Values salesforceClientId and salesforceClientSecret should be received from SFMC team and encrypted

  3. example command to execute:

5. Configure SEARCH functionality

Steps to perform:

  1. Change below example requests according to the needs and execute:

     

6. Configure RTM

7. File extract from CDP to SFMC

8. SFMC to CDP

9. Abandoned Checkout (new)

10. Instant Message Service

11. HyHo Service