Nothing Special   »   [go: up one dir, main page]

Context Driven

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

3/5/2020

Integrations and Data Management


Generated on: 2020-03-05

SAP Commerce | 1905

PUBLIC

Original content: https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/1905/en-US

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product documentation. The
information included in custom documentation may not re ect the arrangement of topics in the SAP Help Portal, and may be missing
important aspects and/or correlations to other topics. For this reason, it is not for productive use.

For more information, please visit the https://help.sap.com/viewer/disclaimer.

Context-Driven Services Foundation Integration


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 1/18
3/5/2020
The Context-Driven Services Foundation integration facilitates the connection between an SAP Commerce instance and Context-Driven
Services Foundation.

Features Architecture Implementation

Pro leservices

Context-Driven Services Foundation Pro le Tag AddOn Consent Management


Integration Overview
Installing Context-Driven Services Foundation Integration with
B2C Accelerator

Installing the Context-Driven Services Foundation Integration


Using the Installer

Manually Installing the Context-Driven Services Foundation


Integration

Con guring Context-Driven Services Foundation and SAP


Commerce

Testing the Installation

Pro le Tag AddOn

Context-Driven Services Foundation Integration


Features
The Context-Driven Services Foundation Integration module facilitates the connection between an SAP Commerce instance and Context-
Driven Services Foundation.

Context-Driven Services Foundation Integration Overview


Context-Driven Services Foundation captures all customer interactions and behaviors to create and enrich a continually evolving
contextual pro le. It surfaces actionable insights for real-time, one-to-one engagements with every customer across all touch
points.

Context-Driven Services Foundation Integration


Overview
Context-Driven Services Foundation captures all customer interactions and behaviors to create and enrich a continually evolving
contextual pro le. It surfaces actionable insights for real-time, one-to-one engagements with every customer across all touch points.

Click streams and order events are an important part of customer interactions. The following set of extensions enable capturing and
processing such click and order events in Context-Driven Services Foundation. The Context-Driven Services Foundation integration allows
the following events to be sent to Context-Driven Services Foundation:

User events

Registration

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 2/18
3/5/2020
Login

Update email address

Update personal details

Update address book

Page View

Product View

Category View

Keyword search

Add to cart

Remove from cart

Change quantity

Consent Management events

Withdraw consent

Closed account

Order events

Order creation

Order shipping status

Complete return (only available if order management is enabled)

Partial return (only available if order management is enabled)

See the following sections for more information and related functionality:

For installation information, see Installing Context-Driven Services Foundation Integration with B2C Accelerator.

For information about other libraries and sub-systems that Context-Driven Services Foundation relies on, see Pro leservices.

For information on how to easily tag websites and capture data that describe customer behavior, see Pro le Tag AddOn.

For an explanation on how the Context-Driven Pro le integration handles consents, see Consent Management.

Context-Driven Services Foundation Integration Overview


The following graphic shows the Context-Driven Services Foundation integration and its interactions with other extensions in SAP
Commerce.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 3/18
3/5/2020

Context-Driven Services Foundation Services Extension


The pro leservices extension listens for the following events and submits the included data to Context-Driven Services Foundation:

User Management events:

SavedAddressEvent: Triggered when the user updates their address.

UpdatedProfileEvent: Triggered when the user updates their personal details.

ChangedUIEvent: Triggered when the user updates a user identi er eld, such as email address.

DeletedAddressEvent: Triggered when the user deletes their address.

ClosedAccountEvent: Triggered when the user closes their account.

ConsentWithdrawnEvent: Triggered when the user withdraws their consent.

Order Management events:

SubmitOrderEvent

ConsignmentProcessingEvent

CreateReturnEvent

The following diagram shows the data ow associated with these order management events.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 4/18
3/5/2020

The profileservices extension also detects when a user registers or logs in. In response, the extension sends a registration or login
event to Context-Driven Services Foundation. The following diagram shows the data ow related to registration and login events.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 5/18
3/5/2020

Related Information
Event System
Dynamic Process De nitions
Pro leservices
Installing Context-Driven Services Foundation Integration with B2C Accelerator
Order Management Services Module

Context-Driven Services Foundation Integration


Architecture
Context-Driven Services Foundation offers a set of extensions that allows you to track user actions, User Management events, and Order
Management events.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 6/18
3/5/2020

Dependencies

Dependencies Diagram

Recipes
There are currently no recipes that include the Context-Driven Services Foundation Integration module.

Extensions
Context-Driven Services Foundation consists of the following extensions:

Pro leservices
The profileservices extension listens to the following events and submits the included data to Context-Driven Services
Foundation.
Pro le Tag AddOn
Tracking consumers on web pages requires capturing data while consumers browse the site. You can usually accomplish this with a
tracking pixel, or tag: code inserted into a web page that sends data to the server. In the past, tracking pixels were transparent GIF
images. Now, tracking pixels are more sophisticated tags based on JavaScript.

Pro leservices
The profileservices extension listens to the following events and submits the included data to Context-Driven Services Foundation.

User Management events:

SavedAddressEvent: Triggered when the user updates their address.

UpdatedProfileEvent: Triggered when the user updates their personal details.

ChangedUIEvent: Triggered when the user updates their email address.

DeletedAddressEvent: Triggered when the user deletes their address.

ClosedAccountEvent: Triggered when the user closes the account.

ConsentWithdrawnEvent: Triggered when the user withdraws their consent.

Order Management events:

SubmitOrderEvent

ConsignmentProcessingEvent

CreateReturnEvent

It also detects when users register or log in and sends both events to Context-Driven Services Foundation.

It includes services related to the consent layer.

Directory
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 7/18
3/5/2020
hybris/bin/modules/cds-integration

Pro le Tag AddOn


Tracking consumers on web pages requires capturing data while consumers browse the site. You can usually accomplish this with a
tracking pixel, or tag: code inserted into a web page that sends data to the server. In the past, tracking pixels were transparent GIF images.
Now, tracking pixels are more sophisticated tags based on JavaScript.

It is cumbersome to manually create and maintain such tags throughout a website. Context-Driven Pro le Tag simpli es tag management
and data capture. Using the easy-to-use user interface, you con gure the way data gets sent to Context-Driven Services Foundation.
Context-Driven Services Foundation offers a exible way to adapt to the structure of your online presence, and allows you to de ne the
events that you create by sending the information you wish to store in Context-Driven Services Foundation.

The Pro le Tag AddOn provides an easy path for users of the B2C accelerator to tag the website and send events to Context-Driven
Services Foundation.

Supported Markets and Channels


The Pro le Tag AddOn supports the B2C market only. It can only be used with the desktop channel.

Supported Markets and Channels

Supported B2C Commerce B2B Commerce Telco Commerce

Market Yes No No

Channel Desktop - Yes Desktop - No Desktop - No


Mobile - No Mobile - No Mobile - No

JS and Tags Components


The Pro le Tag AddOn uses the Pro le Tag library to send asynchronous JavaScript events directly to Context-Driven Services Foundation.
The profileTag.tag le contains the JavaScript code that calls the Pro le Tag script, which then sends the events to Context-Driven
Services Foundation.

CMS Components
This AddOn adds the following CMS components:

ProfileTagScriptComponent: Creates the CMS Javascript component in the accelerator storefronts.

ImpEx
The new CMS components are imported into the Commerce Accelerator with the following ImpEx script.

 Note
The script is found in the hybris/bin/modules/sec-customer-
service/secaddon/resources/secaddon/import/contentCatalogs/electronicsContentCatalog/cms-
responsive-content.impex le

$contentCatalog=electronicsContentCatalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version
$jarResourceCms=jar:com.hybris.yprofile.profiletagaddon.constants.ProfiletagaddonConstants&/profiletagaddon/
$siteUid=electronics
$lang=en

INSERT_UPDATE ConsentTemplate;id[unique=true];name[lang=$lang];description[lang=$lang];version[unique=true];

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 8/18
3/5/2020
;PROFILE;"Allow SAP Commerce Cloud, Context-Driven Services tracking";"We would like to store your browsing

INSERT_UPDATE ProfileTagScriptComponent;$contentCV[unique=true];uid[unique=true];name;
;;ProfileTagScriptComponent;Profile Tag;ProfileTagScriptTagScript;;

INSERT_UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];active;cmsComponents(uid,$contentCV)[mode
;;PlaceholderContentSlot;true;ProfileTagScriptComponent

The profileTagAddonBeforeViewHandler

The profileTagAddonBeforeViewHandler gets executed every time before the view is rendered.
TheprofileTagAddonBeforeViewHandler is responsible for reading the values in the Con guration, and sets these key-values as
model attributes.

Installation
For instructions on installing Context-Driven Services Foundation integration and Pro le Tag AddOn, see Installing Context-Driven
Services Foundation Integration with B2C Accelerator.

Modi cations
The AddOn modi es the Accelerator's ImpEx Con guration Scripts, CMS Components, and JavaScript.

Removing the Consent Reference Cookie


Context-Driven Services Foundation tracks only the type of information for which the consumer or the tenant grants consent. Pro le Tag
allows different consent management settings for each page. In each case, Pro le Tag sends a request to Context-Driven Services to
receive a new consent reference. In every subsequent request, Pro le Tag includes that consent reference, which represents the
customer's consent settings.

Removing the consent cookie for the storefront prevents merging of the pro les for different users using the same browser on the same
computer. To remove the consent reference cookie, perform the following steps:

1. Add the RemoveConsentCookieLogoutHandler class directly to your storefront. An example might be


de.hybris.platform.yacceleratorstorefront.security.cookie.RemoveConsentCookieLogoutHandler.

RemoveConsentCookieLogoutHandler Class

package de.hybris.platform.yacceleratorstorefront.security.cookie;

import de.hybris.platform.basecommerce.model.site.BaseSiteModel;
import de.hybris.platform.site.BaseSiteService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.web.util.CookieGenerator;

public class RemoveConsentCookieLogoutHandler implements LogoutHandler


{
private final String consentReferenceCookieNameSuffix;
private final CookieGenerator cookieGenerator;
private final BaseSiteService baseSiteService;

public RemoveConsentCookieLogoutHandler(final CookieGenerator cookieGenerator, final String consen

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c4… 9/18
3/5/2020
final BaseSiteService baseSiteService)
{
this.cookieGenerator = cookieGenerator;
this.consentReferenceCookieNameSuffix = consentReferenceCookieNameSuffix;
this.baseSiteService = baseSiteService;
}

@Override
public void logout(final HttpServletRequest request, final HttpServletResponse response, final Aut
{
final BaseSiteModel baseSite = baseSiteService.getCurrentBaseSite();
if (baseSite.getUid() != null)
{
final String cookieName = baseSite.getUid() + consentReferenceCookieNameSuffix;
cookieGenerator.setCookieName(cookieName);
cookieGenerator.removeCookie(response);
}
}
}

2. De ne the bean for RemoveConsentCookieLogoutHandler and add it to the list of handlers for the logoutFilter.
Remember to add it before the SecurityContextLogoutHandler.

hybris/bin/modules/platform/samlsinglesignon/web/webroot/WEB-INF/security/spring-security-con g.xml

<bean id ="removeConsentCookieLogoutHandler" class="com.hybris.yprofile.cookie.RemoveConsentCookie


<constructor-arg name="consentReferenceCookieNameSuffix" value="-consentReference" />
<constructor-arg name="cookieGenerator" ref="consentCookieGenerator" />
<constructor-arg name="baseSiteService" ref="baseSiteService"/>
</bean>

<bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilte


<constructor-arg name="logoutSuccessHandler" ref="logoutSuccessHandler" />
<constructor-arg name="handlers">
<list>
<ref bean="removeConsentCookieLogoutHandler" />
<bean class="org.springframework.security.web.authentication.logout.SecurityContextLog
<ref bean="rememberMeServices" />
</list>
</constructor-arg>
</bean>
...

For details on consent management for Context-Driven Services Foundation, see Consent Management.

Context-Driven Services Foundation Integration


Implementation
There are several ways to implement and con gure Context-Driven Services Foundation, depending on your needs.

Consent Management
The Context-Driven Services Foundation integration uses Consent Management to handle consents.
Installing Context-Driven Services Foundation Integration with B2C Accelerator

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 10/18
3/5/2020
The Context-Driven Services Foundation integration can be installed with Commerce B2C Accelerator for a development
environment or for demonstration purposes.

Consent Management
The Context-Driven Services Foundation integration uses Consent Management to handle consents.

By default, one template is available in the Pro le Tag AddOn sample data: PROFILE. Here is an example of the properties of the default
template in an electronics storefront.

 Note
The Java properties of the model class are used as column headers, and not the actual database column headers.

PK ID Version Name Description baseSite

PK1 PROFILE 1 Allow SAP Commerce "We would like to electronics


Cloud, Context-Driven store your browsing
Services tracking behavior so that our
website can
dynamically present
you with a
personalized browsing
experience and our
customer support
agents can provide
you with contextual
customer support."

When a user gives or withdraws consent, the system res ConsentGivenEvent and ConsentWithdrawn. The profileservices
extension reacts to these events and sends a DELETE request to the Consent Service in Context-Driven Services Foundation, which
triggers the deletion of the customer's data. For more details, see the Consent Management section in Context-Driven Services
Foundation Security.

You must de ne the consent template with the ID PROFILE for any other custom website.

$siteUid=customSiteId
$lang=en

INSERT_UPDATE ConsentTemplate;id[unique=true];name[lang=$lang];description[lang=$lang];version[unique=true];
;PROFILE;"Allow SAP Commerce Cloud, Context-Driven Services tracking";"We would like to store your browsing

Installing Context-Driven Services Foundation


Integration with B2C Accelerator
The Context-Driven Services Foundation integration can be installed with Commerce B2C Accelerator for a development environment or
for demonstration purposes.

To install Context-Driven Services Foundation Integration with B2C Accelerator, choose one of these methods:

Use the installer. For more details, see Installing the Context-Driven Services Foundation Integration Using the Installer.

Install manually. For more details, see Manually Installing the Context-Driven Services Foundation Integration.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 11/18
3/5/2020

Installing the Context-Driven Services


Foundation Integration Using the Installer
You can install the Context-Driven Services Foundation Integration with B2C Accelerator for a development environment or for
demonstration purposes using the b2c_acc_plus recipe.

Prerequisites
Before you begin, you will need a local_property:initialpassword.admin=password.

Procedure
Execute the following commands from the installer subfolder.

./install.sh -r b2c_acc_plus setup


./install.sh -r b2c_acc_plus initialize
./install.sh -r b2c_acc_plus start

For more information, see Installing SAP Commerce Using Installer Recipes.

Manually Installing the Context-Driven Services


Foundation Integration
You can manually install the Context-Driven Services Foundation Integration with B2C Accelerator by adding the required extensions and
add-ons to the localextensions.xml le.

Procedure
1. Add the following extensions to localextensions.xml.

...
<extension name='profiletagaddon' /><!--has to be installed on the b2c storefront-->
<extension name='profileservices' />
...

2. Install the add-on by executing ant addoninstall.

This command generates the correct properties in the project.properties le of the profiletagaddon add-on. It also
adds a dependency from your storefront to the profiletagaddon add-on.

ant addoninstall -Daddonnames="profiletagaddon" -DaddonStorefront.yacceleratorstorefront="yaccelerator

ant clean all

3. Start the SAP Commerce Server and proceed to update or initialize the running system.

4. If you do not or cannot load the project data, execute one of the the following impex les manually.

For electronics and apparel storefronts only:

hybris/bin/modules/sap-customer-activity-repository/sappostransactionaddon/resources/sappostransa
hybris/bin/modules/sap-customer-activity-repository/sappostransactionaddon/resources/sappostransa
hybris/bin/modules/sap-customer-activity-repository/sappostransactionaddon/resources/sappostransa

For all other storefronts use the following impex template:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 12/18
3/5/2020

$contentCatalog=YOUR-CONTENT-CATALOG
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVers
$jarResourceCms=jar:com.hybris.yprofile.profiletagaddon.constants.ProfiletagaddonConstants&/profi
$siteUid=YOUR-SITE-UID
$lang=en

INSERT_UPDATE ConsentTemplate;id[unique=true];name[lang=$lang];description[lang=$lang];version[un
;PROFILE;"Allow SAP Hybris Profile tracking";"We would like to store your browsing behaviour so t

INSERT_UPDATE ProfileTagScriptComponent;$contentCV[unique=true];uid[unique=true];name;
;;ProfileTagScriptComponent;Profile Tag;ProfileTagScriptTagScript;;

INSERT_UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];active;cmsComponents(uid,$cont
;;PlaceholderContentSlot;true;ProfileTagScriptComponent

Con guring Context-Driven Services


Foundation and SAP Commerce
After installing the Context-Driven Services Foundation Integration with B2C Accelerator, you need to perform some additional
con guration steps in the Context-Driven Services and in SAP Commerce.

Procedure
1. Set up a Client in the Context-Driven Services.

For more details, see Setting up a Client.

2. Add the Context-Driven Services Foundation con guration to SAP Commerce using ImpEx.

For more details, see Setting up SAP Commerce.

Setting up a Client
You need to set up a client to use with your Context-Driven Services Foundation Integration.

Procedure
1. Sign in to the Context-Driven Services.

2. From the left-hand menu, select Clients and Extensions.

3. Click + CLIENT .

The Add new client dialog box appears.

4. Provide the following details:

Client ID: Enter the ID of your client.

 Note
The Client ID must begin with a lowercase letter (a-z) and must be 2-47 characters long. It can contain lowercase letters
(a-z), numbers (0-9), and dashes (except at the end of the name).

Client name: Enter a meaningful name for your client.

Roles: Select a role for your client.

 Note
To provide successful communication between the module functionality and the cloud platform, select the Commerce
Cloud integration client role.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 13/18
3/5/2020

5. Click ADD .

A pop-up window with the client details appears. It displays all information you entered in the previous step, and additionally
provides you with the client secret.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 14/18
3/5/2020

 Caution
Save your client secret before closing the pop-up window, or else it will be lost. Client secret retrieval is impossible. If the system
forgets your client secret, you can only reset it or generate a new one.

Setting up SAP Commerce


The con gurations performed on the SAP Commerce side can be done using ImpEx.

Importing the Con guration with ImpEx

Context
The following procedure uses the example values shown in the prerequisites.

Procedure
1. In the SAP Commerce Administration Console, go to Console ImpEx Import .

2. Import the following con guration:

$client = <the ID of your SAP Commerce client which you created in CDS lounge. Use your clientId witho
$clientsecret = <the secret you got for this client in CDS lounge>
$region = <the region in which this tenant is created, e.g. US or EU>
$projectid = <the tenant ID, e.g. htv730339940>
$profiletagconfigurl = <the URL of your Profile Tag configuration JSON, e.g. https://tag.static.us.con
$basesite = <the site within your SAP Commerce instance, which shall be configured for CDS, e.g. "elec

# No changes necessary below this point


$profiletagurl = https://tag.static.$region.context.cloud.sap/js/profile-tag.js
$edgeservice = https://$projectid.api.$region.context.cloud.sap/edge
$oauthservice = https://$projectid.api.$region.context.cloud.sap/uaa/oauth
$consentservice = https://$projectid.api.$region.context.cloud.sap/consent

INSERT_UPDATE DestinationTarget;id[unique=true];destinationChannel(code)[default=CDS]
;$projectid;CDS
INSERT_UPDATE ConsumedOAuthCredential;id[unique=true];clientId;clientSecret;oAuthUrl
;$projectid.$client;$projectid.$client;$clientsecret;$oauthservice

INSERT_UPDATE Endpoint;id[unique=true];version[unique=true];specUrl;name
;ProfileClient;v1;"empty";"Profile Client v1"
;ConsentServiceClient;v1;"empty";"Consent Service Client v1"
;ProfileTagUrl;v1;"empty";"Profile Tag Url v1"
;ProfileTagConfigUrl;v1;"empty";"Profile Tag Config Url v1"

INSERT_UPDATE ConsumedDestination;id[unique=true];url;additionalProperties(key,value)[map-delimiter=|]
;ProfileClient$basesite;$edgeservice;baseSite->$basesite|clientClassName->ProfileClient;ProfileClient;
;ConsentServiceClient$basesite;$consentservice;baseSite->$basesite|oauth.scope->cds.roles.customerec|c
;ProfileTagUrl$basesite;$profiletagurl;baseSite->$basesite|clientClassName->ProfileTagUrl;ProfileTagUr
;ProfileTagConfigUrl$basesite;$profiletagconfigurl;baseSite->$basesite|clientClassName->ProfileTagConf

3. Include the following values in your ImpEx con guration:

Field Value Remarks

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 15/18
3/5/2020

Field Value Remarks

$client Your client with the Commerce Cloud integration Used for authentication purposes.
client role.

$clientSecret The client secret created with the scopes for Context-Driven Used for authentication purposes.
Services Foundation.

$region The region of your tenant. Used for authentication purposes.

$projectId The ID of your tenant, usually starting with htp or htv. Used for authentication purposes.

$profiletagconfigurl The URL of your Pro le Tag con guration JSON. Used for enabling the Pro le Tag feature.

$baseSite The ID of your SAP Commerce base site, such as apparel-uk. Used for mapping a tenant to a base site.

Testing the Installation


You can test whether your installation of Context-Driven Services Foundation Integration with B2C Accelerator was successful by going
through a few steps.

Procedure
1. Go to your storefront, for example, https://localhost:9002/yacceleratorstorefront?site=electronics.

This is an example of a default storefront. You may have con gured your own storefront, so be sure to use the correct link.

2. Add the query parameter profileTagDebug=true to the URL to get a more verbose console logging.

3. Switch to the inspect mode of your browser.

4. To capture the consent reference that identi es your pro le, perform the following actions:

a. Choose the Network tab.

b. Filter for events.

c. Click the result.

d. Find the consent-reference and copy its value.

5. Go to the Context-Driven Services.

a. Click your project.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 16/18
3/5/2020
b. Select Development from the menu.

a. Select Pro le Explorer.

6. Fill out the Pro le Id eld with the consent-reference copied in the previous step and click the search button.

The corresponding pro le appears:

For more information, see Context-Driven Services Foundation.

Debug Mode Enablement


Tracking allows you to collect details about the exact time of calls between services, and the duration of speci c operations. Additionally, it
allows you to detect any latency problems.

You can track the events sent from the storefront to Context-Driven Services Foundation in the Trace Explorer.

To enable tracing in your storefront, use Pro le Tag in the debug mode. Activate the pro le Tag debug mode by adding the
pro leTagDebug ag to your storefront URL and setting its value to true. A sample storefront's URL
https://electronics.local:9002/yacceleratorstorefront with the debug ag looks as follows:
https://electronics.local:9002/yacceleratorstorefront?profileTagDebug=true.

To navigate to the Trace Explorer, click the contextTraceId link that appears at the top of the screen each time the storefront sends an
event to Context-Driven Services Foundation. In the Trace Explorer, you can nd the logs containing the details of event processing, such
as the information about the changes that your events introduce to the pro le document.

When the debug mode is enabled, Pro le Tag AddOn prints the contextTraceId in the development console of the browser. For the
backend events, the contextTraceIds are printed in SAP Commerce. For example:

 Code Syntax
{HYBRIS_HOME_DIR}/log/tomcat/console-YYYYMMDD.log

INFO [hybrisHTTP1] [10.27.78.166] [CharonHandler] baseUrl:https://api.eu.context.cloud.sap/profile-edge/


INFO [nioEventLoopGroup-2-6] [DefaultProfileTransactionService] Event sent to yprofile. With Status: 201

To disable debug mode, add the pro leTagDebug ag to your storefront URL and set its value to false.

For more information, see Context-Driven Services Foundation.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 17/18
3/5/2020

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=60a3ba003ad8465cb9c22a0b7c… 18/18

You might also like