NUTRINTG Middleware basic configuration
- Sebastian Baltruszewicz
Approved by:
Add new Shopify shop integration to CDS or CDP
adding each shop requires separate configuration for order and customer data
CUSTOMERS
Step to perform:
For CDP integration → request to CDP for creating the set of metadata for customers
For CDS integration → Create a bucket with integration-tool
Fill bucket data with relevant data (JSON part may be filled with empty JSON => { } )
Generate a new schema name and schema (keep “Require at least 1 agreement” as marked)
Delete generated schema from “type” value (row 6 all the way down):
Paste the JSON from the file “CDS_order_schema_forTool” below right under the “title”
Go to Integration rule section, and paste the attached integration rule
This is a standard integration rule for the customer, however, make sure that values are in line with the columns in the SFMC DE
Create a bucket (schema, bucket, add brands, integration rule)
Configure Middleware by executing relevant INSERTS
configure CUSTOMER SERVICE
Change the query:
_id = shop domain
hmacKey = encrypted HMAC (received from Shopify). Notice encryption differs between services and environment
subscriptionId = in case of integration with CDP value should be received from Epsilon, in case of integration with CDS, the value should be unique
Agreements should be changed accordingly to business needs
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 } ] })
configure ROUTER
possible queues:
PROD:
middleware-message-cds-queue
middleware-profile-message-cdp-queue
STAGE:
middleware-message-cds-queue-stage
middleware-profile-message-cdp-queue-stage
An example query to execute:
db.getCollection('middlewareMessageRouter_accountSourceToSinkMapping').insert({ "accountSource" : "VNMDURCHEETAH0001", "sink" : "middleware-message-cds-queue" })
configure CDS ADAPTER (in case of CDS integration, for CDP step is not required)
Change the query according to the created bucket and account source code
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:
For CDP integration → request to CDP for creating the set of metadata for customers
For CDS integration → Create a bucket with integration-tool
Fill bucket data with relevant data (JSON part may be filled with empty JSON => { } )
Generate a new schema name and schema (keep “Require at least 1 agreement” as unmarked)
Delete generated schema from “type” value (row 6 all the way down):
Paste the JSON from the file “CDS_order_schema_forTool” below right under the “title”
Go to Integration rule section:
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
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)
Execute (create schema, create bucket, add brands, add integration rule)
Go back to the first view and change DE key for purposes of creating second integration rule
Do not change the schema, go to Integration rule section and paste second integration rule
Execute (add integration rule)
Configure Middleware by executing relevant INSERTS
ORDER for CDP
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 OrdercdpShopifyOrderAdapter_shopifyDomains
SHOP_DOMAIN - the Shopify shop domain, the same as for cdpShopifyOrderService_shopifyDomains
CUSTOMER_ACCOUNT_SOURCE - the same as for cdpShopifyOrderService_shopifyDomainsmiddlewareMessageRouter_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 tomiddlewareProfileSearchService_accountSourceToDestinationMapping
ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
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 marketcdpSfmcJourneyService_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
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 skippedcdsMiddlewareMessageAdapter_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)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 tomiddlewareInstantMessageService
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 marketcdpSfmcJourneyService_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
configure ROUTER
possible queues:
PROD:
middleware-message-cds-queue
middleware-order-message-cdp-queue
STAGE:
middleware-message-cds-queue-stage
middleware-order-message-cdp-queue-stage
example query:
configure CDS ADAPTER (in case of CDS integration)
Make sure to add “/{orderId}” at the end of the “url”
example query:
configure CDP ADAPTER
Do not change “filesConfig” part of the query
example query:
2. Configure campaign via Profile Service (used by Husky and BARF app from Shopify team)
Profile for CDP
(Optional - only when profile comes from Shopify) cdpShopifyCustomerService_shopifyDomains
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 tomiddlewareProfileSearchService_accountSourceToDestinationMapping
ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
middlewareInstantMessageService
ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
API_EVENT - the API-event of customer Journey for a given marketcdpSfmcJourneyService_tokenConfig
API_EVENT - the API-event of Journey - the same as for middlewareInstantMessageService
Profile for CDS
(Optional - only when profile comes from Shopify) cdpShopifyCustomerService_shopifyDomains
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 tocdsMiddlewareMessageAdapter_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)middlewareInstantMessageService
ACCOUNT_SOURCE - the same as for middlewareMessageRouter_accountSourceToSinkMapping configuration
API_EVENT - the API-event of customer Journey for a given marketcdpSfmcJourneyService_tokenConfig
API_EVENT - the API-event of Journey - the same as for middlewareInstantMessageService
Step to perform:
For CDP integration → request to CDP for creating the set of metadata for customers
For CDS integration → Create a bucket with integration-tool
Fill bucket data with relevant data (JSON part may be filled with empty JSON => { } )
Generate a new schema name and schema (keep “Require at least 1 agreement” as marked)
Delete generated schema from “type” value (row 6 all the way down):
Paste the JSON from the file “CDS_order_schema_forTool” below right under the “title”
Create relevant for the campaign integration rule, a recommended tool for creating new integration rules → http://jolt-demo.appspot.com/#inception
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:
example integration rule to be pasted into the integration-tool:
f. Create a bucket (schema, bucket, add brands, integration rule)
Configure Middleware by executing relevant INSERTS
configure ROUTER
possible queues:
PROD:
middleware-message-cds-queue
middleware-profile-message-cdp-queue
middleware-profile-message-cds-fulfillment-exchange
middleware-profile-message-cdp-fulfillment-exchange
middleware-profile-message-cdp-qeepsake-fulfillment-exchange
STAGE:
middleware-message-cds-queue-stage
middleware-profile-message-cdp-queue-stage
middleware-profile-message-cds-fulfillment-exchange-stage
middleware-profile-message-cdp-fulfillment-exchange-stage
middleware-profile-message-cdp-qeepsake-fulfillment-exchange-stage
An example query to execute:
configure CDS ADAPTER (in case of CDS integration, for CDP step is not required)
Change the query according to the created bucket and account source code
An example query to execute:
3. Configure WayIn campaign
Steps to perform:
Execute steps from the section “configure new campaign via Profile Service”
Add addition configuration in MongoDB. Change below example requests according to the needs and execute:
_id = account source
acceptLanguage = accept language
brandOrgCode = brand org code
programCode = program code
sourceCode = source code
tierCode = tier code
subscriptionChannelCode = subscription channel code
subscriptionId = subscription id
4. Configure Abandoned Checkout service (deprecated)
Steps to perform:
Keep in mind that “shopifyToken” is “{API_KEY}:Password” encoded in BASE64 and encoded with MongoDB encryption relevant for the environment and service
example:
Shopify team create an app to allow Middleware to send the request to the shop
The app has API KEY = “aaa” and password = “xxx”
We need to encode “aaa:xxx” in base64 to receive encoded value “YWFhOnh4eA==”
encrypt “YWFhOnh4eA==” with relevant mongo DB encryption key
Values salesforceClientId and salesforceClientSecret should be received from SFMC team and encrypted
example command to execute:
5. Configure SEARCH functionality
Steps to perform:
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