<style>
/* .codeContent .syntax highlighter table td.code.container.line {
    white-space: nowrap !important;
} */
.code {
	white-space: nowrap !important;
}
.syntaxhighlighter, .code.container {
	white-space: nowrap !important;
}
div.line {
    white-space: nowrap !important;
}
</style>

Guide to integrating Gigya with the SAP Commerce Cloud (previously Hybris) e-commerce platform.

Commerce Cloud Overview

Create an immersive shopping experience with Gigya’s extension for SAP Commerce Cloud (previously Hybris). Gigya’s social technology combines the core elements that power e-commerce - product awareness and discovery coupled with customer acquisition and loyalty - into a comprehensive set of features and services that are designed to keep customers engaged as well as increase shopping cart conversions while on SAP Commerce Cloud websites.

The Gigya extension provides two main Customer Identity Management packages:

The extension supports SAP Commerce Cloud multi-site configurations. In addition, the Gigya extension provides a generic Gigya plugin that can be used to embed any of Gigya's social plugins within your Commerce Cloud websites, and a purchase synchronization feature that enables you to track user purchase activity using Gigya's Customer Insights analytics tool.

 

Versions and Compatibility

Latest Versions

For support of Commerce Cloud versions 1811 and above, use the native connector that is built-in to Commerce Cloud, for additional information see: https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/1811/en-US/4fc06a3539a940e6b707c0c543d44053.html

Legacy Versions

For versions between versions 6.2 and 1808 (6.8), this documentation will show you how to install and maintain the GConnector for Commerce Cloud.

 

Instructional Video

If you have an SAP logon, you can watch instructional videos about this integration here

 

Note that after installing the installation, your point of reference for users should be "Gigya User", and not the regular "User" available in SAP Commerce Cloud: 

All features and user interfaces are fully configurable, require little time to install and can be controlled from the Administration Panel.

Note that user data is updated periodically by a cron job. See below for more information. 

Please note that support for Gigya Social Login as a separate plugin will not be available in future versions of this extension, starting with SAP Commerce Cloud 6.0. Social login will still be available as a feature of RaaS - Registration-as-a-Service.


Installation and Implementation

Prerequisites

Before installing the Gigya Extension for SAP Commerce Cloud, make sure that:

1. Download and Install the Extension

To install the extension:

  1. Download the latest extension here: 
  2. Copy the gigya-addon folder to ${HYBRIS_BIN_DIR}\custom folder.

    1. SAP Commerce Cloud 6.5 and later
      1. Add “gigyacommon”, “gigyalogin” and “gigyaconsent” to localextensions.xml
        Run the following commands, replacing yourstorefront with your storefront name:

        ant all
        ant addoninstall -Daddonnames="gigyacommon" -DaddonStorefront.yacceleratorstorefront="yourstorefront"
        ant addoninstall -Daddonnames="gigyalogin" -DaddonStorefront.yacceleratorstorefront="yourstorefront"
        ant addoninstall -Daddonnames="gigyaconsent" -DaddonStorefront.yacceleratorstorefront="yourstorefront"

       

    2. SAP Commerce Cloud 6.2 - 6.4

      1. Add "gigyacommon" and "gigyalogin" to localextensions.xml.
        Run the following commands, replacing yourstorefront with your storefront name:

        ant all
        ant addoninstall -Daddonnames="gigyalogin" -DaddonStorefront.yacceleratorstorefront="yourstorefront"
        ant addoninstall -Daddonnames="gigyacommon" -DaddonStorefront.yacceleratorstorefront="yourstorefront"

        Run the following commands, replacing yourstorefront with your storefront name:

     

2. Configure Basic Settings

Log into the SAP Commerce Cloud Back Office. In the left sidebar, under Administrator, you should now see a Gigya folder.

If you are setting up your Gigya extension for the first time, right-click gigyaConfig in the Gigya Configuration in the Back Office, and click Create. For subsequent edits to the configuration, in the Back Office, open Gigya Configuration and select the relevant configuration. 

 

In the Back Office, a configuration wizard opens. 

 

Fill in the following fields (some are optional):

NameDescription
gigyaApiKeyThe site's Gigya API key.
gigyaDataCenter

The Gigya data center used by your implementation.

gigyaLoginBehavior (Deprecated)In this drop-down, you may choose between "loginExistingUser" or "Always login". The default is "loginExistingUser". See Adding Connections When the User is Not Logged In for information about this option.
gigyaSiteSecret *The Partner Secret Key (not required if you have a User Key + User Secret).
gigyaUserKey *Your Gigya User Key.
gigyaUserSecret *Your Gigya User Secret.

* You must enter EITHER gigyaSiteSecret OR gigyaUserKey + gigyaUserSecret.

StorefrontClick to locate and select the SAP Commerce Cloud storefront connected to this Gigya congifuration.
modeIn this drop-down, choose "social" if you want to use Gigya for social login or "raas" if you have acquired and plan to use the full RaaS service.
providersThe social providers you wish to use. The default is "*" for all providers. To limit the service to specific providers, enter them in a comma-delimited list (e.g. "facebook,twitter").
siteIn this box, click the Search button to display a list of sites. Choose the site you want to connect to the extension.

Finally, click Create to save your settings.

User data between Gigya and Hybris is synced based on Gigya's UID. For more information, see UID-Based Sync.

3. Configure Your Own Encryption (OPTIONAL)

By default, the extension includes encryption for the application key and secret. No configuration is required to set up encryption. 

If you wish to configure your own encryption, you may do so by adding code to the local.properties file as follows.

 Customized encryption should only be performed by admins with a good knowledge of SAP Commerce Cloud customizations.

In the local.properties file, add lines according to the following example, with the encryption provider you are using. In this example, the provider is Bouncy Castle: 

encryption.provider.signature=BC
encryption.provider.class=org.bouncycastle.jce.provider.BouncyCastleProvider

symmetric.algorithm=256AND256BITAES-CBC-BC
symmetric.key.file=256bit-symmetric.key

When loading a SAP Commerce Cloud instance, the public key will be generated inside the symmetric.key file.

You can specify the key directly inside the local.properties file. For more information, see the documentation.

4. Set Up Social Login (OPTIONAL)

To use the extension in Social Login mode, you need to create a Social Login Component to use in your website.

The Gigya Social Login component can be inserted in any secure (HTTPS) page in your website, where it will display as social network buttons (see the setup section below for customization options):

Setup

To set up Social Login:

  1. Open the SAP Commerce Cloud Management Console.
  2. In the left sidebar, under Administrator, choose WCMS.
  3. Right-click Component and choose Create > GigyaSocialLoginComponent.

    Click to enlarge screenshot

  4. In the component, go to the Administration tab and fill out a Name and ID (e.g. "showLoginUI") and the Catalog Version.
  5. Scroll down to the Unbound section to configure Gigya parameters, such as buttonsStyle and containerID. You will find information about these parameters in the documentation for the Gigya JS API method socialize.showLoginUI.
  6. Optionally, you may use the advancedConfig setting to configure any other parameter that socialize.showLoginUI offers. Enter the parameters in JSON object format, for example:

    {"redirectURL": "http://www.example.com", "showTooltips": "false"}
    
  7. Click Create.

Now you can use the SAP Commerce Cloud CMS Cockpit to insert the Gigya Social Login component into a web page.

5a. Set up the General Screen-Set Component (OPTIONAL)

By creating a Gigya General Screen-Set Component in your SAP Commerce Cloud single storefront website, you link it to one of the Gigya’s RaaS screen-sets, such as Login, Registration, Profile Update, etc.

If you are using SAP Commerce Cloud in an SSO scenario, skip this section and proceed with Step 5b. Set up the Register/Login Component (OPTIONAL), below.

 

 

In the Step 1 (General) section:

In Step 2 (Screens) section:

In Step 3 (Advanced) section (optional):

 

5b. Set up the Register/Login Screen-Set Component (OPTIONAL)

This component is intended specifically for login, registration, and logout process.

The purpose of this component is that when you are in SSO group, in order to guarantee the session synchronization between all sites, you must use the Register/Login Screen-Set Component instead of the General Screen-Set Component. The main difference between both components is that the Register/Login Component contains a link through which a logout process is triggered. You should always use the Register/Login Component for Login and Registration and the General Screen-set Component only for user update flows (i.e., Edit Profile or Lite Registration).

In Step 1 (General) section:


RaaS Screen-Sets and Flows

Gigya's RaaS offers the following screen-sets.

Screen-Set ComponentScreen-SetDescriptionImplemented Flows (Click link for more details and a flow diagram)
Register/LoginDefault-RegistrationLoginAllows the user to log in or register. Also enables the user to initiate a password reset.Login, Registration, Forgot Password
GeneralDefault-ProfileUpdateAllows the user to edit their profile.Update Profile
Register/LoginDefault-ReAuthenticationEvoke this screen-set to require the user to re-authenticate anywhere added security is needed.Re-Authentication
Register/LoginDefault-LinkAccountsWhen a user is trying to register with a social account that shares an email address with an existing registered account, this screen-set can be evoked to merge the two accounts.Link Accounts
GeneralDefault-LiteRegistrationWhen a currently anonymous user would like to subscribe to a newsletter or register for an event with only their email address. Lite users can not login and do not have registered accounts.Newsletter Subscription or any other instance when you only require the user's email address and they do not need to have a full account.

New User Creation

RaaS includes social login in that it allows users to log in with a social network; otherwise they can register as a site user with a user ID and password. In any case, new users, whether they are social users (logged in with a social identity) or site users (registered in the site) are created both in the Gigya system and in your Hybris database.

6.  Integrating Customer Data Cloud Consent (OPTIONAL)

If you are using SAP Commerce Cloud < 6.5 you will map any Consent objects using the normal Field Mapping functionality as you would for any other Gigya field. This section is only relevant for SAP Commerce Cloud v6.5 or greater and only if you installed the gigyaconsent Addon in step 1.2 a during Installation of the GConnector.


Consent Template Creation

In order to synchronize gigya consent object to hybris, consent template should be created first. Without template the synchronization won’t be triggered. Based on the consent template a consent object is created/updated in hybris during login/registration/profile update flow and the value of ‘isConsentGranted’ field is synched. Bear in mind that the id of the template have to be exactly the same like id of the gigya consent in the gigya console. For instance if we have consent in gigya console with id = terms.test.consent, when we create a template in order to synch this object we have to put the same id.

In the Required (Required Fields) section:

 

Customization

The following video demonstrates the various customization options of the GConnector with SAP Commerce Cloud: 

<iframe src="https://drive.google.com/file/d/1BYVll7TNNAe9BcdJzLyWwm5C7ECoVozR/preview" width="640" height="480"></iframe>

 

Session Management

When using the GConnector with your site, you can manage your sessions in a number of different ways.

To configure sessions, navigate to the Session Management tab of the Gigya tab.

 

Press the PLUS button ( + ) to begin the wizard and use the guidelines below to configure your sessions.

 

First you may choose whether you want the GConnector to manage the sessions or use SAP Commerce Cloud. If you choose SAP Commerce Cloud (Hybris), then everything is handled by the Hybris CMS and the following configurations do not apply.

 

 

If you choose Gigya to lead the session, then the GConnector will control when the sessions end. The options available when selecting Gigya are as follows:

 

After saving your first configuration, the Session Management page will look similar to the following.

 

At which point you can add additional configurations or edit existing ones, if needed, via the bottom pane of the page.

 

Session management configuration is complete. You can utilize a single session configuration between some or all of your storefronts, it is not necessary to create multiple configurations, unless you want the storefronts to have different session configurations.

If your storefront is part of an SSO group and you use Sliding (dynamic) Sessions on any of the sites of the group, all sites within the SSO group MUST use sliding sessions. Otherwise, SSO will not function properly. See Managing Session Expiration for additional information.

 

Field Mapping

By default, the following required Hybris fields are mapped from Gigya to Hybris on registration, login, and profile update:

Map additional necessary fields following the instructions below:

 

 


Select the Gigya configuration or site you would like to apply the mapping to. 

  1. Click Create or Save

Complex attributes are Hybris attributes (or Gigya JSON objects) that hold other fields within. To map such fields, you need to enhance the converter (hook). For more information, see below.

How to map an email to SAP Commerce Cloud ID

  1. Create a Field mapping
  2. Select synchronization direction (Generally it is good practice to have identifiers synced only in one direction Gigya to Hybris)
  3. We will be using the email from the profile object so on the Gigya’s attribute name we will enter: profile.email
  4. On Hybris attributes name we will enter: uid
  5. Select String as type
  6. Select the configuration/storefront to which you will assign the mapping
  7. Click Create

It is important to note that SAP Commerce Cloud uses 3 individual fields to keep track of the user. Even though we are mapping either the Gigya UID or Gigya profile.email to SAP Commerce Cloud UID, the specified field is also being mapped to Hybris fields named:

  • originalID
  • ID (Hybris uid)

The field named gigyaUID is always the Gigya UID regardless of whether you are setting the SAP Commerce Cloud UID as the Gigya UID or profile.email.

Default mapping is only from Gigya to the CMS, syncing data the other way requires using custom hooks.

Mapping Complex Fields - Advanced

For example, a complex attributes could be a SAP Commerce Cloud product. They hold other models inside them: images, price groups, discounts etc.

 

{
	"USA": {
		"Texas":{
			"Dallas":{
				"Population":"1.281 million",
				"Elevation": "131m",
				…
}
				}
		}
}

If you want to map attribute from inner layers of the JSON to an attribute in the GigyaUserModel you can set the Gigya attribute’s name, for example profile.countryThis will map attribute that is in the following structure:

{ 
 	"Created":"21.03.2016"
 	"Registered":"21.03.2016"
 	"isActive":"true"
	 "Profile":{
			   "firstName":"John",
			   "lastName":"Smith",
			   "country":"USA"
  }
}

The Hybris attribute name is the name of the attribute inside the items.xml file and type system. For example if you have GigyaUserModel.getCountry(), you can write "country" in Hybris’ attribute name.

The SAP Commerce Cloud GConnector uses a custom converter whose bean ID is gigyaCustomerAccountConverter. To map complex fields, you need to extend this converter, by creating a populator which is added to the converter's list of populators. This is advanced configuration, and requires developer expertise in Hybris. 

To customize a converter: 

  1. Define a custom ID and class for your populator, for example:

    <bean id="gigyaCustomerKidsPopulator" class="com.gigya.login.service.converters.populators.GigyaCustomerKidsPopulator "/>
  2. Example structure for a populator: 

    public class GigyaCustomerKidsPopulator implements Populator<GSResponse, GigyaUserModel>
    {
     private static final Logger LOG = Logger.getLogger(GigyaCustomerKidsPopulator.class);
    
     @Override
     public void populate(GSResponse gsResponse, GigyaUserModel customerModel)
     {
       customerMode.setKids(gsResponse.getData().getInt(“kids”));
    //More implementation
    }
    }
  3. In the spring of the extension, assign modifyPopulatorList as a parent to your bean. For example, if the name of your bean is gigyaCustomerKidsPopulator, the code would look like this: 

    <bean parent="modifyPopulatorList">
       <property name="list" ref="gigyaCustomerAccountConverter"/>
       <property name="add" ref="gigyaCustomerKidsPopulator"/>
    </bean>

Available converters: 

Converter NameModel
gigyaCustomerAccountConverterGigyaUserModel
gigyaLoginIDsConverterLoginIDsModel
gigyaCustomDataConverterGigyaCustomDataModel

In addition, the gigyaCustomDataReverseConverter is available for converting custom data from Hybris back into Gigya's data (custom) fields. 

 

Schedule Data Sync

The data in the mapped fields (above) is synced automatically every time a user logs in, or a user's profile is updated (regardless of whether it is being updated via the user or user or a Backoffice User). You can configure the way the synchronization will be handled in your Gigya Configuration. This synchronization happens via tasks or in the same thread as the update/login. By default, all synchronizations are asynchronous. 

You can also schedule a manual synchronization for a single user. Enable Data Sync by following the steps below:

Data Sync Technical Information

Synchronization Strategy

Synchronization strategy in the Gigya Configuration has direct impact on the performance. We recommend using the asynchronous strategy for all cases. When the synchronization is asynchronous a synchronization task will be scheduled for immediate execution.

Retry mechanism

The task has retry mechanism built in. The intervals between retries are growing with each fail with 15 minutes. Failures will not affect the login/update procedure or any other functionality. Each synchronized field is independent from the others, meaning that if one fails the other(s) will be synchronized.

Retry configuration

The retry mechanism is configurable via the properties files.

You can set the number of retries by giving the following property:

By default this value is set to 5.

 

Importing existing users from a 3rd party system to Gigya via the SAP Commerce Cloud GConnector is not currently supported.

 

 

Generic Gigya Plugin

The Generic Gigya Plugin allows you to choose any social plugin offered by Gigya insert it into your Hybris website as a component. The functionality and design of each plugin can be customized extensively using Gigya API parameters.

Some of the Gigya plugins are:

For a full list of social plugins and usage guides, see the Gigya Plugins documentation.

To create the component:

  1. Open the Hybris Management Console.
  2. In the left sidebar, under Administrator, choose WCMS.
  3. Right-click Component and choose Create > GigyaGenericPluginComponent.
  4. In the component, go to the Administration tab and fill out a Name and ID and the Catalog Version.
  5. Scroll down to the Unbound section and enter the function name. This can be any function in the Gigya JS API. For example, to use Gigya's Share Bar plugin, enter "socialize.showShareBarUI". see the Gigya Plugins documentation for descriptions and technical details of the available plugins.
  6. Enter the parameters of the function according to the Gigya JS API documentation. Enter the parameters in JSON object format, i.e. {"key1": "stringvalue1", "key2": "stringvalue2"}.
    For example:

    Click to enlarge screenshot

  7. The Show Anonymous and Show Logged In radio buttons allow you to specify whether the plugin will be visible to anonymous users and to logged-in users. By default, it is shown to everyone.
  8. Click Create.

Notes:

  • For sharing plugins, if a userAction object isn't passed in the function parameters, the plugin will look for an image with relevant Open Graph tags within the same page, and share that image. If no image has Open Graph tags, the plugin will share the largest image in the page.
  • Some Gigya plugins allow user registration. To enable users to register from within a Gigya plugin embedded as a component, make sure to set gigyaLoginBehavior to "Always login" in the General Setup.

Purchase Synchronization

Once you activate the Gigya extension, Gigya's Signals service (if it is available) begins to count user purchases and purchase amounts. Note that Signals is a premium feature and requires separate activation. Information from Signals is used in Customer Insights and the accumulated purchase values will show under Revenue Activity in Customer Insights.

Customer Insights allows you to analyze your website's performance by cross-referencing social network information, such as demographics and Facebook Likes, against the customers' activity on your site, including purchases.

Troubleshooting

SAP Commerce Cloud-Related Troubleshooting

 
<script>
$(document).ready(function() {
    lssdk.tools.renamePage("child","https://developers.gigya.com/display/GD/SAP+Commerce+Cloud");
	lssdk.seo.fix();
	lssdk.tableFixer();
	console.warn("---X---");
	tVar1.table.style.tableLayout = "fixed";
	lssdk.tables.colorRows(tVar1);
});
</script>

 

 

Save

Save

Save

Save