Skip to Content
Author's profile photo Anilkumar Vippagunta

Social Media Integration with SAP Hybris Commerce – Getting Started!

Please go through the part-1  for introduction.

So, you are ready to go social! Let’s get started!

What are the prerequisites:

You must create apps for Facebook and Twitter, as per your integration requirement, to fetch the activity details from these social channels.


Use a Facebook developer account ( ) to create the app.

  • Navigate to My Apps menu and create the app by providing a display name and a contact email for the app.
  • In the Apps dashboard, select Add Product and then select ‘Facebook Login”.
  • Select ‘Web’ as the platform for the app and provide your enterprise Website URL.
  • On the Facebook Login product’s settings page, provide a OAuth redirect URL i.e. the URL of your enterprise Website.
  • Provide a privacy policy URL in the app’s basic setting. This URL must be provided by the customer and it should state the purpose of the application and the user data fetched and stored by the app. Provide instructions also to remove this personal data from the system.


Use your Twitter account to create an app on Twitter.

  • On the Twitter Apps page (, click Create New App and provide the app details, the Website and the Callback URLs (Website and callback URL will be your enterprise Website URL).
  • Navigate to the settings tab and provide the Privacy policy URL and Terms of service URL for your enterprise and update the settings (Required to fetch the user’s email ID from Twitter). This URL must be provided by the customer and it should state the purpose of the application and the user data fetched and stored by the app. Provide instructions also to remove this personal data from the system.
  • Go to Permissions tab, select Request email addresses from users and update the settings.


  1. Install the Hybris Marketing recipe b2c_acc_ymkt in SAP Hybris Commerce 6.6.
  2. Configure the Hybris marketing server details such as OData URL, username and password.
  3. Extract and place the downloaded social integration extensions inside custom folder or a newly created folder in the \hybris\bin folder of your Hybris installation.
  4. Add the below extensions to localextensions.xml
    1. Socialconnectaddon
    2. Socialconnectbackoffice
  5. Install the Socialconnectaddon on yacceleratorstorefront.
  6. Download the jars required for Socialconnectaddon from the maven repository:
    1. spring-social-core-2.0.0.M2.jar
    2. spring-social-facebook-3.0.0.M1.jar
    3. spring-social-twitter-1.1.2.RELEASE.jar
  7. Run the ant command (ant clean all initialize) inside the platform folder.
  8. As mandated by Data Protection and Privacy laws, the customer needs to provide a link on the storefront, that displays the privacy statements mentioning the usage of customer data retrieved from social platforms like Facebook, also indicating how this information is used and how it can be deleted.

During initialization, the basic configurations for social login and the CMS customizations for social integration components are created.


Hybris Commerce:

  1. Add the below properties to ‘properties’ file.

Properties for Facebook application:

  •<Get app ID from the developer portal>
  • app.client.secret=<Get app secret from the developer portal>

Properties for Twitter application:

  • app.api.key=<Get API key from the apps portal>
  • app.api.secret=<Get API secret from the apps portal>

Set up brand page ID:

  •<ID of the facebook brand page>
  1. Configure Facebook app ID and app version in js file. This information needs to be set in FB.init() method’s appId field and version field respectively. This is required to carry out Facebook related operations in the front end.
  2. Start the Hybris server and login to Backoffice as the administrator.
  3. Navigate to Social Connect Services node and select social login provider info.

Edit the social login provider information for Facebook and Twitter, and update the social login component attribute. Select the existing Social Login Component created during initialization. (Please ensure that you select the component in the online electronics content catalog).

  1. Navigate to Social Connect Services node, select FacebookYMKTConfiguration and create FacebookYMKTConfiguration item. Specify the scenario ID as present in marketing system, Interaction type as ‘CLICK_THROUGH’, user type as ‘EMAIL’, and ymkt item type as ‘SAP_HYBRIS_PRODUCT’.

Facebook shareable component in the store front:

To view a sample Facebook shareable component in the store front, go to cmscockpit or smartedit and add a sample component (already created during initialization) in homepage’s Section1Slot-Homepage slot.

Get Access Token to fetch likes information from Facebook brand page:

To fetch likes information from Facebook, the Facebook brand page owner’s user access token is required. To get the access token follow the steps below:

  1. Log in to Facebook as Facebook brand page owner.
  2. Check the link to get info about the access token and when it expires.
  3. Get the extended token and save it in the cronjob model (with code fetchFBInfoCronJob) in Hybris.
  4. On executing the cronjob information is pulled from the configured brand page ID.

Send likes information as interaction to Hybris marketing:

To send information as interaction to Hybris marketing the cronjob sendFBLikesInfoCronJob needs to be executed. This job validates the posts and the people who like them, and sends the details to Hybris Marketing if they are also registered Hybris commerce customers.

Data protection and privacy requirements:

The basic data protection and privacy requirements applicable to the addon are fulfilled by SAP Hybris Commerce 6.6. Some enhancements have been made to handle the information processed by the addon.

  1. User Deletion: A customer can initiate a request to close his account, from the storefront. On closure, the customer account goes through a retention period after which all personal data is deleted from Hybris Commerce. The customer must also contact customer care to ensure that any data sent to Hybris Marketing is manually deleted from the marketing system.


  1. User Reporting: A customer can any time request a report of all the information stored about him in Hybris Commerce. This report is now enhanced to include social login and social likes information stored in the system. Generation of the report involves the steps below:
    1. Customer contacts the customer support agent to request for the report.
    2. Customer Support agent logs into Hybris Commerce Backoffice.
    3. The agent searches and finds the customer using his ID, selects the customer and clicks Create Audit report. The following options are available to create the report:
  1. Report Type: Snapshot
  2. Language: English or any other available language
  • Report Template: Default
    1. The agent then clicks on the Personal Data Reports link and searches for the report using the customer ID.
    2. Agent selects the report, and this report that contains the personal details of the customer can be downloaded from the General tab.
  1. Log Changes to Personal Data: To know what changes have been made to a customer’s personal data, an Audit report can be generated in the same manner as the customer report is generated. Select the report type as Audit to generate the audit report. This report contains the history of changes made to the customer details, including the time of change and the name of the user who made the change.

Identity and Access Management:

The social integration add-on uses standard OAuth 1 and OAuth 2 authentication mechanisms to process the login. These processes are enabled by the usage of spring-social, an open source spring project. On successful validation by the Software as a Service (SaaS) providers like Facebook or Twitter the user is registered on Hybris storefront.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Jayachandra G
      Jayachandra G

      Nice document. It is very useful to integrate with social media.Is it possible to upload the products from SAP hybris to Social Media.

      Thank you.


      Author's profile photo Niall Brennan
      Niall Brennan

      Does this include support for Google as a login source?

      Author's profile photo Sezer Ozer
      Sezer Ozer

      How could I download social integration extensions?