Home - gigya/wordpress GitHub Wiki

WordPress GConnector for SAP Customer Data Cloud Integration

Overview

The SAP Customer Data Cloud plugin for WordPress allows you to integrate SAP Customer Data Cloud's customer-identity management platform throughout your WordPress site. With this plugin, you can easily build and maintain secure and scalable registration, authentication, profile management, data analytics and third-party integrations. Increase registrations and identify customers across devices, consolidate data into rich customer profiles, and provide better service, products and experiences by integrating data into marketing and service applications.

Version and Compatibility

SAP Customer Data Cloud's WordPress GConnector is compatible with:

  • WordPress versions up to 6.5.5
  • PHP versions 7.3.X - 8.2.0

To view the version of your SAP Customer Data Cloud WordPress plugin, go to the WordPress Admin Panel and select Customer Data Cloud > Global Settings.

View update details on the latest and earlier versions in our Change Log.

Main Features

Customer Identity Management

The SAP Customer Data Cloud GConnector provides two main customer identity management packages:

  • Registration-as-a-Service (RaaS) - An end-to-end user management system package. This platform offers a comprehensive cloud-based user registration system that supports login by social networks while allowing sites to maintain a unified user database for both social and traditional site authentication. For additional information and advanced implementation options, see Customer Identity.
  • Social Login - The plugin can be used as an external authentication system, allowing users to sign up to your site using their social networks. As with standard WordPress registration, new WordPress user accounts will be created in the process.

Administration & Configuration

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

Implementing the Plugin in Your Site

Implementation of the SAP Customer Data Cloud plugin follows three stages:

  • Installing the SAP Customer Data Cloud Plugin for WordPress - Installing the plugin is easy and does not require any programming skills.

    Note:

    If you are using an older (4.x) version of the plugin, see Upgrading the SAP Customer Data Cloud WordPress Plugin instead.

  • SAP Customer Data Cloud Plugin and Widget Configuration - The plugin requires some basic configuration. Some widgets need to be enabled before you can use them.

  • Adding the SAP Customer Data Cloud Widgets - As a final step, you may choose which widgets to add and where you want them in your site. Alternatively, you may use SAP Customer Data Cloud WordPress Shortcodes for embedding SAP Customer Data Cloud widgets in your site with greater degree of flexibility.

For compatibility with multi-site WordPress installations, see Using the SAP Customer Data Cloud Plugin in Multi-Site Installations.

For advanced users, we provide Advanced Customization options for customizing the implementation through code using Actions and Filters.

Installing the SAP Customer Data Cloud GConnector for WordPress

Note that there are two modules for WordPress:

  • The core module
  • The user deletion module.

Note: If you are not using the user deletion module, you should not install it.

Downloading and Installing the Core Module

If you are already using an older (4.x) version of the plugin, see Upgrading the SAP Customer Data Cloud WordPress Plugin instead.

Prior to installation:

Follow the installation steps below:

  1. Download the SAP Customer Data Cloud Plugin for WordPress here on our Github: https://github.com/gigya/wordpress.

  2. Access your site’s server through an FTP application and upload (copy) the plugin's unzipped folder to the /wp-content/plugins folder.

  3. In your WordPress Administration Panel, click Plugins in the main menu.
    You should see your new plugin listed:

    Note:

    If you don't see the SAP Customer Data Cloud plugin listed, try the following: check the "plugins" folder with your FTP program and see whether "Customer Data Cloud" is located there. If not, upload the files again. If it is located there, delete the files and upload them again.

  4. Click the Activate link below the "SAP Customer Data Cloud – Make Your Site Social" plugin title. The page should now show the SAP Customer Data Cloud plugin as active.
    In the sidebar, you should now see a "Customer Data Cloud" item.

RaaS

Implementing SAP Customer Data Cloud's Registration-as-a-Service (RaaS) requires additional preparation. See Using RaaS with WordPress for implementation instructions and other important information.

Roles and Permissions

Access to the SAP Customer Data Cloud secret Key is limited for security reasons. By default, the Secret Key can only be edited and viewed by network admins (in a multi-site installation) or admins (in a single-site installation). Any other users of the page, including site admins in a multi-site installation, cannot see or edit the Secret Key.

If you edit WordPress permissions or create your own user roles (using one of the available third-party plugins), you may change these settings. The installation of the SAP Customer Data Cloud plugin adds two WordPress permissions to the system. You may grant them to any user role and assign that role to users as needed:

  • edit_gigya – gives general access to SAP Customer Data Cloud plugin options
  • edit_gigya_secret – gives access to the SAP Customer Data Cloud Secret Key

Installing the User Deletion Module

  1. Download the SAP Customer Data Cloud - User Deletion plugin from here: Gigya Developer Downloads.
  2. Unpack and upload the folder to the the /wp-content/plugins/ directory on your website.
  3. Go to the Plugins tab in the WordPress administration panel, find the SAP Customer Data Cloud - User Deletion plugin and click Activate.
  4. For configuration instructions, see below.

UID-Based Sync

Data sync between SAP Customer Data Cloud and Wordpress is based on Customer Data Cloud's UID. This way, user information is independent of any input provided by the user (such as name or email), and passed consistently between systems, so as to provide a seamless integration and improve the users' experience. The UID field is created automatically in Wordpress when installing the GConnector. When configuring SAP Customer Data Cloud for CMS integrations, the email is always the login identifier (included in the loginID). Following is a flow that describes the logic:
MISSING IMAGE

Caution:

SAP Customer Data Cloud GConnector for Wordpress =< version 5.2.x requires all users to be synced using their SAP Customer Data Cloud UID (previously you could sync based upon email also). This means that all new installations or upgrades require users to be synced via their SAP Customer Data Cloud UID.

Note that the UID is synced from the usermeta table, where the meta_key is gigya_uid.

When updating your site to use the latest SAP Customer Data Cloud GConnector for Wordpress, it is important to follow these steps:

  1. Backup your user database.
  2. Make sure that the SAP Customer Data Cloud UID is updated in all of the existing user records, including backoffice users.
  3. Install the new GConnector for Wordpress.

SAP Customer Data Cloud Plugin Configuration

After the SAP Customer Data Cloud WordPress plugin has been installed, both the plugin and widgets can be configured through the WordPress Admin Panel under the SAP Customer Data Cloud entry.

Under SAP Customer Data Cloud you will find the following tabs, which configure global SAP Customer Data Cloud settings, such as which social networks to use:

  • Global Settings: Global Settings are general settings affecting all the widgets.
  • User Management: Enable and configure the Registration-as-a-Service (RaaS) or Social Login widgets.

Widgets are added from the Appearance option in the WordPress Admin Panel. Additional options, such as the widget's title in your site, are set when adding the widget. For instructions on adding widgets, see [Attaching SAP Customer Data Cloud's WordPress Widgets](#Attaching-SAP Customer Data Cloud's-WordPress-Widgets).

Advanced Extension Customization

If you wish to extend or override the SAP Customer Data Cloud functionality using the WordPress "hooks" methodology, learn more here.

Global Settings

The settings in this section define basic configurations of the SAP Customer Data Cloud integration on your WordPress site.

Field Default Description
SAP Customer Data Cloud API Key TBD The API key for your site domain that was generated for you in the SAP Customer Data Cloud site (see Site Setup). This is copied by clicking the site API key in SAP Customer Data Cloud's Console.
SAP Customer Data Cloud User Key TBD The SAP Customer Data Cloud application key or user key. For more information, see Signing Requests to SAP Customer Data Cloud.
User Key secret / Private Key secret N/A Defines whether to use the secret associated with the userKey, or the private RSA Async key.
SAP Customer Data Cloud Secret Key / Async Private Key TBD The SAP Customer Data Cloud application secret or user secret. For more information, see Signing Requests to SAP Customer Data Cloud. Be sure to enter the correct key as defined in the previous radio button selection.
Data Center US Data Center The location of the data center associated with your SAP Customer Data Cloud account. Default is 'US', however if you are using a different one (e.g Europe) change it here. Options are: US Data Center – United states (default option); EU Data Center – Europe; AU Data Center – Australia; Other - For using a custom Data Center. When selecting the Other option, you will be prompted to enter the name of your data center. Add the prefix of the data center URL (e.g. the URL for the European data center is eu1.gigya.com, therefore the prefix for it will be 'eu1'). The name is an acronym that represents the data center you will be using. If you are not sure, contact your Customer Data Cloud Implementation Consultant to receive the name of your data center. This option is meant to support data centers that are added between versions.
List of Providers * The default asterisk (*) setting denotes all available providers. To include only specific providers, type a comma-separated list of the providers. For the full list of available providers, refer to the global configuration object page.
Language English The language in which SAP Customer Data Cloud screens and features will be displayed. If your desired language is not in the list, it can be manually added under Additional Parameters, below. For a list of supported language codes, see Advanced Customizations and Localization.
Additional Parameters (advanced) (no default) This box enables you to specify configuration options beyond those available in the fields above. For details, see Additional Parameters (advanced), below. For the list of available configuration options, refer to the Global Conf page. Technical note: The Global Configuration automatically fulfills the SAP Customer Data Cloud requirement to insert a Global Conf block of code in the header section of any page of your website that has a SAP Customer Data Cloud block in the page body (the block calls the main SAP Customer Data Cloud Web SDK and initializes the SAP Customer Data Cloud API. The configuration is passed as an object to the script call).
Enable Google Social Analytics No Select to enable the Google Social Analytics plugin. For details, refer to the Third-Party Analytics Integration page.
Enable SAP Customer Data Cloud debug log No Select to enable the SAP Customer Data Cloud Plugin debug log. When checked, the plugin logs all SAP Customer Data Cloud's requests and responses into Wordpress's logging system. Learn more about configuring the logging system in WordPress.

Remember to click the "Save Changes" button before continuing.

Additional Parameters (advanced)

Most of the SAP Customer Data Cloud settings tabs include an Additional Parameters (advanced) box. These boxes enable you to specify configuration options beyond those available in the other fields for that tab.

Additional parameters must be entered in "JavaScript Object Notation" (JSON) format. The required format is {"key1":"value1","key2":"value2", ..., "keyN":"valueN"} where "key" represents the name of the API method field and "value" is the value you are passing to it.

For example, the following use of JSON sets values for the Global Conf object's enabledProviders and ShortURLs fields: {"enabledProviders":"facebook, twitter", "shortURLs":"whenRequired"}

Note:

The Additional Parameters in all sections override existing configurations and must be used carefully.<
The Additional Parameters cannot include events or hooks.

User Management Settings

The settings in this section configure the user registration and management (RaaS and Login) widgets.

There are three basic options under User Management, and the settings displayed vary depending on the option you select:

  • WordPress only – This (default) option disables SAP Customer Data Cloud 's login and user management. The Widgets remain available.

  • WordPress + Social Login – This option enables SAP Customer Data Cloud's social login, allowing users to login to your site using their social networks and enabling the Login widget. User management is handled by WordPress.

  • Registration-as-a-Service – This option enables both SAP Customer Data Cloud's social login and user management, giving you extended data and control over your site users and enabling the RaaS widget.

WordPress + Social Login

If you choose to enable SAP Customer Data Cloud's social login without SAP Customer Data Cloud's registration-as-a-service, the following User Management Settings are displayed:

Field Default Description
Button Style Standard Specify how Social Login buttons are displayed. The default option is Standard and the other options are Full Logos or Sign In With.
Connect Without Login Behavior (Deprecated) Login existing user Deprecated
Width 210 Specify the display width of the login widget in pixels.
Height 110 Specify the display height of the login widget in pixels.
Post Login Redirect (No default) You can choose the page to which your users will be redirected after logging in. To redirect to your blog's home page, enter http://localhost/wordpress. For your blog admin page, enter http://localhost/wordpress/wp-admin/.
Login Providers N/A A comma delimited list of providers that should be displayed on this plugin. Valid provider names include: facebook, twitter, yahoo, messenger, googleplus, linkedin, aol, foursquare, i nstagram , renren, qq, sina, vkontakte, blogger, wordpress , paypal, amazon, netlog, orangefrance, mixi, odnoklassniki, spiceworks, livedoor, xing. For example, if you would like this plugin to show only the icons of Facebook and Twitter, define: facebook,twitter.
Show Terms Link No Select Yes to display a link to the SAP Customer Data Cloud terms of use agreement.
Show Complete Registration Form No Select Yes if you have defined required fields in your site registration form. When checked a 'Complete Registration' form will pop up during user social registration, to let the user enter the missing required fields.
Additional Parameters (advanced) LoginUI (no default) This box enables you to specify configuration options beyond those available in the fields above. For details, refer to the Additional Parameters (advanced) section. For the list of available configuration options, see the parameters table in the socialize.showLoginUI API page.
Additional Parameters (advanced) AddConnectionsUI (No default) This box enables you to specify configuration options beyond those available in the fields above. For details, refer to the Additional Parameters (advanced) section. For the list of available configuration options, see the parameters table in the socialize.showAddConnectionsUI API page.
First Name Yes Select Yes to map SAP Customer Data Cloud User.firstName field to WP's "First Name" field. Once mapped, the WP field is populated from the SAP Customer Data Cloud field whenever a user registers.
Last Name Yes Select Yes to map SAP Customer Data Cloud User.lastName field to WP's "Last Name" field. Once mapped, the WP field is populated from the SAP Customer Data Cloud field whenever a user registers.
Nickname Yes Select Yes to map SAP Customer Data Cloud's User.nickname field to WP's "Nickname" field. Once mapped, the WP field is populated from the SAP Customer Data Cloud field whenever a user registers.
Avatar Yes Select Yes to map SAP Customer Data Cloud's User.photoURL field to WP's "Avatar" field. Once mapped, the WP field is populated from the SAP Customer Data Cloud field whenever a user registers.
Biographical Info Yes Select Yes to map SAP Customer Data Cloud's User.bio field to WP's "Biographical Info" field. Once mapped, the WP field is populated from the SAP Customer Data Cloud field whenever a user registers.

Mapping SAP Customer Data Cloud User Fields to WordPress Fields – SAP Customer Data Cloud plugin supports pushing data from SAP Customer Data Cloud's User object fields into WordPress user fields. You may select below which fields to map. As a consequence, when a user registers, the data will be copied from the RaaS fields to the corresponding mapped WordPress fields. Learn more in Mapping SAP Customer Data Cloud User Fields to WordPress Fields.

Enabling Social Login activates the Login widget. You do not have to use the widget and can rely on existing WordPress links, which will open the standard WordPress login page with added social network options (see image). You can use the Login widget to customize the sign-in options within your site. See below for an explanation of how to add the Login widget.

For more information on the SAP Customer Data Cloud Login plugin, you can refer to the Login plugin page and to the socialize.showLoginUI API method. See help.sap.com

The SAP Customer Data Cloud plugin uses version 2 of both the socialize.showLoginUI and the socialize.showAddConnectionsUI APIs.

Mapping SAP Customer Data Cloud User Fields to WordPress Fields

SAP Customer Data Cloud plugin supports pushing data from SAP Customer Data Cloud User fields into WordPress user fields. You can configure which fields to map. As a consequence, when a user registers the data will be copied from the SAP Customer Data Cloud fields to the corresponding mapped WordPress fields. Currently we support, through the Admin panel, mapping to the following out-of-the-box WordPress fields:

  • First Name
  • Last Name
  • Nickname
  • Avatar
  • Biographical Info

If you wish to mirror additional fields, such as custom-created fields, you can do so using the 'gigya_after_social_login ' hook. Learn more about SAP Customer Data Cloud hooks here.

Registration-as-a-Service

If you choose to implement SAP Customer Data Cloud's full Registration-as-a-Service package, the following settings are displayed.

To implement RaaS, follow the instructions in the Using RaaS with WordPress page.

Note:

Make sure that the screen-set IDs defined in your integration's settings match the screen-set IDs defined for your site in the Screen-Sets page in the SAP Customer Data Cloud console.

  • If your SAP Customer Data Cloud RaaS was set up in the SAP Customer Data Cloud Console after 10/26/2015, it is using new default screen-set names, which do not match the screen-set names used by this integration out-of-the-box. To set up your integration to use the correct screen-sets names, go to your integration settings and select Registration-as-a-Service settings. In the screen-set IDs table, copy the ID of every Web Screen-Set into the matching Mobile Screen-Set. For example, in the integration's default settings, the Registration/Login screen-sets are set to Default-RegistrationLogin and DefaultMobile-RegistrationLogin, for web and mobile, respectively. They should both say Default-RegistrationLogin.

  • If your site was set up in the SAP Customer Data Cloud console before September 2014, it will be using older screen-set names.

See Default Screen-Sets for more information.

Field Default Description
Connect without Login Behavior Always Login For users not logged into the site, this field determines login requirements for performing a SAP Customer Data Cloud social action (for example, sharing, reacting, or commenting). options include: Always login – before proceeding with the SAP Customer Data Cloud social action, users are first directed to site login; Login existing user – social actions are allowed with no requirement to log into the site, behind the scenes, the following happens when such users successfully access one or more social networks: Registered site users are automatically logged into the site & Other users are logged into the site as temporary users.
Post Login Redirect (No default) You can choose the page to which your users will be redirected after logging in. To redirect to your blog's home page, enter http://localhost/wordpress. For your blog admin page, enter http://localhost/wordpress/wp-admin/.

Login/Registration Screen-Sets – The screens used for new user registration and existing user login. For more information, see the Screen-sets tool and the Default Screen-Sets. Changes to these settings require prior definition of screen-sets.

Field Default Description
Web Screen-Set ID Default-RegistrationLogin Name of a web screen-set containing the screens used in managing user login.
Mobile Screen Set ID DefaultMobile-RegistrationLogin Name of a mobile screen-set containing the screens used in managing user login.
Login Screen ID gigya-login-screen Name of the initial user login screen. This is a screen defined in the web and mobile screen-sets (with the same name in both). The default screen-set uses the same screens with different CSS.
Register Screen ID gigya-register-screen Name of the new user registration screen. This is a screen defined in the web and mobile screen-sets (with the same name in both). The default screen-set uses the same screens with different CSS.

Profile Screen-Sets – The screens used for entering and updating user profile information.

Field Default Description
Web Screen Set ID Default-ProfileUpdate Name of a web screen-set containing the screens used in entering user profile details.
Mobile Screen Set ID DefaultMobile-ProfileUpdate Name of a mobile screen-set containing the screens used in entering user profile details.

Override Wordpress Link

Field Default Description
Override Wordpress Link Yes Selecting Yes overrides the Wordpress Login, Registration and Edit Profile links, redirecting the user to the relevant SAP Customer Data Cloud RaaS screens instead of WordPress pages. You can find these links in WordPress's "Meta" widget, which can be found in the default store.

DIV IDs – The HTML DIV IDs in which the screen-sets should be embedded.

Field Default Description
Login loginform Within the WordPress login page.
Register registerform Within the WordPress registration page.
Profile profile-page Within the WordPress user profile page.

Mapping SAP Customer Data Cloud User Fields to WordPress Fields

The connector supports saving data from SAP Customer Data Cloud fields to WordPress fields. The following SAP Customer Data Cloud fields are mapped by default:

  • profile.email
  • profile.firstName
  • profile.lastName

To add field mapping definitions of your own, paste a JSON-like text into the Full field mapping box, according to the following format:

Parameter Name Description
cmsName Name of WordPress field (case sensitive). When mapping a SAP Customer Data Cloud user field to a WordPress custom field, you need to indicate that this is a custom field, by adding the prefix custom_ to the cmsName, e.g. custom_vipCustomer.
gigyaName Name of SAP Customer Data Cloud field (case sensitive).

Example:

  [  
    {  
      "cmsName": "prefix",  
      "gigyaName": "profile.nickname"  
    },  
    {  
      "cmsName": "middlename",  
      "gigyaName": "data.middle_name"  
    }  
  ]  

Field Mapping UI

You can also add field mapping via the UI:

Using Hooks for Advanced Field Mapping

Before a field value from SAP Customer Data Cloud is saved to WordPress, it can be modified using a custom event. This allows you to customize your field mapping even further, and to deal with complex object fields, and/or fields that require reformatting.

The name of the hook is gigya_pre_field_mapping. It is possible to modify the input array in any way, but an array with an identical structure must be returned.

Supported parameters:

  • gig_user : The user object stored in SAP Customer Data Cloud
  • wp_user : The user object stored in WordPress

Following is an example hook that prettifies the registration date:

  add_filter( 'gigya_pre_field_mapping', 'gigyaPreFieldMapping', 10, 2 );  
  function gigyaPreFieldMapping( $gig_user, $wp_user ) {  
    $registered = new DateTime($gig_user['registered']);  
    $gig_user['registered'] = $registered->format('F j, Y');  
  
    return $gig_user;
  }  

Admin Login Roles – Select below which roles should be permitted to login via standard WordPress login UI (in /wp-login.php ). Learn more in Admin Users, Roles & Permissions.

Field Default Description
Check All No Select this checkbox to check all the boxes - meaning all the roles listed below will be allowed to login via standard WordPress login UI. If you create a new custom role after checking the "Check All", the new role will not be checked automatically after creation. You will need to check it manually (it will be listed below after refresh), or re-check the "Check All" again.
Author Yes An out-of-the-box WordPress role. This role is selected by default, meaning Authors are allowed to login via standard WordPress login UI by default.
Editor Yes An out-of-the-box WordPress role. This role is selected by default, meaning Contributors are allowed to login via standard WordPress login UI by default.
Other custom roles No If you add custom roles in you site, these roles are listed below. The custom roles are not selected by default, i.e., not allowed to login via standard WordPress login UI by default.

Enabling Registration-as-a-Service enables the RaaS widget. You do not have to use this widget and can continue to rely on the standard WordPress login link, which will now open a SAP Customer Data Cloud login pop-up (see image) instead of the standard WordPress page.

You can use the RaaS widget to customize the location, size and title of the login link. See below for an explanation of how to add the RaaS widget .

To access the WordPress dashboard after activating SAP Customer Data Cloud's RaaS enter /wp-login.php?admin=true after your site's URL, as in http://<your-domain>/wp-login.php?admin=true.

Out of Sync Users – Press the Generate Report button to create a set of .csv reports that will show you the extent of synchronization between users between SAP Customer Data Cloud and WordPress. The reports are: WordPress but no SAP Customer Data Cloud, SAP Customer Data Cloud but not WordPress, WordPress/SAP Customer Data Cloud non-matching UIDs. The check is run on a sample of up to 10,000 random users. The results provide a simpling, based on which you can gauge the extent of synchronization between the systems, and optionally consider whether to modify your settings to improve it.

Login Verification Mode – Select whether to sync users with WordPress based on UID (recommended option) or based on both UID and email.

Session Management

Installations that implement RaaS can set up session management between SAP Customer Data Cloud and WordPress.

Session Synchronization between the Platforms

When the GConnector is configured, the WordPress user session mirrors the SAP Customer Data Cloud user session:

  • When a user logs into SAP Customer Data Cloud in your site, they are also logged into WordPress.
  • When a user logs out from SAP Customer Data Cloud, they are also logged out from WordPress.

Session Expiration

Before you configure the session, we highly recommend that you familiarize yourself with SAP Customer Data Cloud's Session Management documentation.

To configure the length of the users' sessions:

  1. In the connector configuration menu, select Session Management.
  1. Choose the sessionType:
  • Sliding: correlates to setting the sessionExpiration parameter to -1. Define the session duration in the next field.
  • Fixed: The duration of the session equals to the defined session duration. Once that time has passed, the user is logged out.
  • Valid forever: correlates to setting the sessionExpiration parameter to -2.
  • Until browser closes: correlates to setting the sessionExpiration parameter to 0.
  1. If you defined a fix or a sliding duration, specify the Duration (in seconds).
  2. Save changes.

Note:

We recommends using dynamic sessions whenever inside an SSO group. For additional information, see Managing Session Expiration.

To enable single-logout for a site group, see GConnector Single Logout In SSO Groups.

Share Settings

Share is deprecated as of January 31st, 2021 and will no longer function. If you are currently using any settings here, you should remove them from your implementation prior to January 31st, 2021.

Comments Settings (or Rating & Reviews)

Comments are deprecated as of January 31st, 2021 and will no longer function. If you are currently using any settings here, you should remove them from your implementation prior to January 31st, 2021.

Reactions Settings

Reactions are deprecated as of January 31st, 2021 and will no longer function. If you are currently using any settings here, you should remove them from your implementation prior to January 31st, 2021.

Gamification Settings

Gamification/Loyalty is deprecated as of January 31st, 2021 and will no longer function. If you are currently using any settings here, you should remove them from your implementation prior to January 31st, 2021.

User Deletion

When users are deleted from the SAP Customer Data Cloud database, that information should be synced to WordPress, to ensure users are deleted there as well. This process is done using IdentitySync, SAP Customer Data Cloud's ETL solution, as follows:

  1. IdentitySync retrieves user deletion events from the SAP Customer Data Cloud Audit Log.
  2. These events are stored in an Amazon S3 bucket in a CSV file that contains a list of the UIDs of the deleted users.
  3. The CSV file is uploaded into WordPress using the user deletion module.
  4. The module deletes users from WordPress, or marks users as "Gigya deleted", meaning the users still exist and function like regular users, leaving it up to the site admin to decide how to handle them. In addition, a hook is fired, which can be used for inserting custom code to handle the user deletion.
  5. An email is sent, specifying the number of users deleted successfully (or marked as deleted), or the ones for which deletion failed. This guide assumes you have already set up an Amazon S3 bucket and have the credentials prepared, and have configured access to IdentitySync.

Note:

The user deletion functionality is enabled in a separately installed module. For more information, see above.

To configure user deletion:

A. Create a Data Flow in IdentitySync

  1. Open IdentitySync Data Flows in SAP Customer Data Cloud Console.
  2. In the dashboard, click Create Data Flow.
  3. In the Create Data Flow window, select any value for the "Integration" and "Data Flow" drop-downs.
  4. Click Continue. As a result, the IdentitySync Studio screen opens in the dashboard.
  5. Click the Source tab.
  6. Copy the following code and paste it instead of the existing data flow:
  "name" : "Export deleted users from Gigya to S3",
      "description" : "account > rename > dsv > gzip > sftp",
      "steps" : [{
              "id" : "account",
              "type" : "datasource.read.gigya.audit",
              "params" : {
                  "select" : "UID",
                  "where" : "endpoint = 'accounts.deleteAccount'"
              },
              "next" : ["dsv"]
          }, {
              "id" : "dsv",
              "type" : "file.format.dsv",
              "params" : {
                  "fileName" : "GIGYA_DELETED_USERS_${now}.csv",
                  "columnSeparator" : ",",
                  "quoteFields" : true
              },
              "next" : ["s3"]
          }, {
              "id" : "s3",
              "type" : "datasource.write.amazon.s3",
              "params" : {
                  "bucketName" : "",
                  "accessKey" : "",
                  "secretKey" : "",
                  "objectKeyPrefix" : ""
              }
          }
      ]
  }
  1. Add the relevant Amazon credentials (bucket name, access key, secrey key, object key prefix). For more information, see the Component Repository.
  2. Save the dataflow and schedule the times at which to run it. You should also test the flow. For more information, see IdentitySync.

B. Install the User Deletion Plugin

SAP Customer Data Cloud's user deletion plugin is separate from the main SAP Customer Data Cloud plugin. The plugin uses Amazon PHP SDK version 3.

Install it like you would the regular plugin:

  1. Download the plugin from the WordPress marketplace.
  2. Unzip the contents in the wp-content/plugins directory.
  3. Activate the plugin in WordPress:
    3a. In your WordPress Administration Panel, click Plugins in the main menu.
    3b. Click Activate below the "Gigya User Deletion Settings" plugin.

C. Schedule the Deletion Task

The WordPress cron job is considered unreliable, and depends on site traffic to work properly. Therefore, we recommend setting up a scheduling job in the operating system, and not relying on WP-cron.

If you are using the operating system scheduler, the command should reference your site domain, followed by /wp-cron.php?doing_wp_cron. For example, if setting up the cron in Linux, to run the deletion job every 5 minutes, you can use:

  */5 * * * * wget -q -O - https://your-domain.com/wp-cron.php?doing_wp_cron

Note that the scheduler that is part of the user deletion configurations uses the WordPress cron. If you do use that configuration, you should set up the cron job on WordPress.

D. Configure the User Deletion Module

  1. Open the user deletion settings.
  1. Select the action: whether to delete the users from the WordPress database (Full user deletion), or to flag them as having been deleted from the SAP Customer Data Cloud database (Tag deleted user). Note that the module includes two hooks, one for each 'deletion' type. For an explanation of the hooks, see below.
  2. If you are using the WordPress cron job, set the frequency (in seconds) for running the job. This setting will work only if the WordPress cron is enabled (i.e. DISABLE_WP_CRON is not set to true in wp-config.php) (see Schedule the Deletion Task above).
  3. Add the email address(es) to which a notification should be sent upon successful or failed completion of the deletion job.
  4. Add the details of the Amazon S3 settings: Access key, Secret key, Server/region, Bucket name, Object key prefix.
  5. Save changes.

Handling Deletion Notification

When users are tagged as deleted, an indication is added to the usermeta table in WordPress:

  • meta_key = is_deleted, meta_value = 1
  • meta_key = deleted_date, meta_value = [unix timestamp]

The user deletion module includes hooks for adding custom code to handle user deletion. This is required especially in the case of tagging deleted users, where the user has been deleted from SAP Customer Data Cloud, but you do not wish to delete them automatically from the WordPress database. The hooks are:

  • gigya_pre_delete_user: fired before user deletion, allows you to make certain checks so as to decide how to handle the user.
  • gigya_on_tag_user_deletion: fired when a user is successfully tagged as deleted in the SAP Customer Data Cloud database.

The following sample demonstrates using the gigya_pre_delete_user hook to check whether the user has made any purchase in WooCommerce, and only if they haven't, proceeds to delete the user:

  add_filter( 'gigya_pre_delete_user', array($this, 'delete_if_no_orders'), 10, 2 );
  function delete_if_no_orders( $wp_uid ) {
  return ( count( get_posts( array(
         'numberposts' => -1,
         'meta_key'    => '_customer_user',
         'meta_value'  => $wp_uid,
         'post_type'   => 'shop_order',
         'post_status' => 'wc-completed'
     ) ) ) === 0 );
  }

The following sample demonstrates using the gigya_on_tag_user_deletion to add a '_deleted' suffix after the user's UID:

  add_action( 'gigya_on_tag_user_deletion', 'delete_user_hook', 10, 2 );
  function delete_user_hook( $wp_uid ) {
    global $wpdb;
    if ( $wp_user = get_user_by( 'id', $wp_uid ) )
      $wpdb->update( $wpdb->users, array( 'user_login' => $wp_user->get( 'user_login' ) . '_deleted' ), array( 'ID' => $wp_uid ) );
  }

Adding the SAP Customer Data Cloud Widgets to Your Site

Note:

The below section is relevant to plugin ver. 6 and below. For newer versions, these widgets were deprecated.

SAP Customer Data Cloud provides the following widgets for your site:

  • RaaS or Login (depending on the choice made in the User Management Settings).
  • Comments - DEPRECATED
  • Gamification - DEPRECATED
  • Reactions - DEPRECATED
  • Share - DEPRECATED

Important Notes:

  • Before adding SAP Customer Data Cloud widgets, you must Install the SAP Customer Data Cloud plugin for WordPress and configure the plugin (you must at least specify User Management Settings).
  • Some widgets must be se tup and enabled in the SAP Customer Data Cloud plugin settings before they can be used.
  • Some widgets require Customer Identity.

To add a widget:

  • Select Appearance and then click on Widgets. Users who choose RaaS (Registration-as-a-Service) in the User Management Settings will see a SAP Customer Data Cloud RaaS widget, users who choose Social Login will see a SAP Customer Data Cloud Login widget.
  • Click on the Widget you want to add: SAP Customer Data Cloud comments, SAP Customer Data Cloud Gamification, SAP Customer Data Cloud Reactions or SAP Customer Data Cloud Share.
  • Select a location: Primary sidebar, Content sidebar, or Footer widget area and then click the "Add Widget" button.

A box will appear for entry of options specific to this widget (the example below shows the comments widget). Options available by widget:

  • Comments – DEPRECATED.
  • Gamification – DEPRECATED.
  • Login – A title for the WordPress display, select Override to change the width and height of the widget.
  • RaaS – A title for the WordPress display, select Override to change the width and height of the widget.
  • Reactions – DEPRECATED.
  • Share – DEPRECATED.

Using SAP Customer Data Cloud's WordPress Shortcodes

The Customer Data Cloud plugin provides a set of shortcodes as an alternative means for embedding SAP Customer Data Cloud's WordPress Widgets in your site. Using shortcodes allows a greater degree of flexibility in the placement and usage of Widgets on WordPress sites. Note that before embedding SAP Customer Data Cloud shortcodes, you must install the Customer Data Cloud WordPress plugin. After the installation configuration is required: you must at least specify User Management Settings and make sure the relevant features are enabled.

SAP Customer Data Cloud provides the following shortcodes for your site:

  • [gigya-social-login] – shows the Social Login widget.

  • [gigya-raas-login] – shows a RaaS login/registration widget. The widget shows two links, each pops-up the corresponding RaaS's Login/Registration screens.

    When the user is logged-in the widget disappears. This shortcode doesn't accept parameters, you may customize it through CSS.

  • [gigya-raas-profile] – shows a RaaS profile widget. The widget shows the user's avatar and name, and a "LogOut" link for logging out. The name is a link, clicking it pop-up RaaS's Update Profile screen-set.

    When the user is logged-out the widget disappears. This shortcode doesn't accept parameters, you may customize it through CSS.

  • [gigya-share-bar] – DEPRECATED.

  • [gigya-comments] – DEPRECATED.

  • [gigya-reactions] – DEPRECATED.

  • [gigya-gm-achievements] – DEPRECATED.

  • [gigya-gm-challenge-status] – DEPRECATED.

  • [gigya-gm-leaderboard] – DEPRECATED.

  • [gigya-gm-user-status] – DEPRECATED.

Configuration and Parameters

All admin configuration options apply to the shortcodes. Note that if a plugin is disabled in the admin configuration, it will disable the shortcode as well.

The shortcodes accept parameters. If you pass shortcodes parameters, they would override the admin configuration. The parameters that the shortcodes accept are the corresponding SAP Customer Data Cloud plugin parameters. However, due to WordPress limitation, the parameter names are slightly changed: instead of camel case the parameters should be written with all lower case letters and underscores between words.

For example: [gigya-social-login] shortcode accepts the socialize.showLoginUI parameters, e.g. buttonsStyle, facebookExtraPermissions, width. We'll change the parameters names to: buttons_style, facebook_extra_permissions, width, and pass them as the shortcode attributes:

  [gigya-social-login buttons_style="full_logo" facebook_extra_permissions="user_likes" width=100]
  // Buttons_style="full_logo" and width=100 override your corresponding WordPress + Social Login configuration.

Some of the SAP Customer Data Cloud features require setup and enabling in the SAP Customer Data Cloud Plugin Configuration before they can be used.

Using the SAP Customer Data Cloud Plugin in Multi-Site Installations

Of the various multi-site configurations offered by WordPress, the following are supported for integration with SAP Customer Data Cloud:

(A) All sites share the same base domain:

This includes both configurations where sites reside in separate sub-domains and configurations where the sites are kept in sub-directories. In both cases, there is only one site to set up with SAP Customer Data Cloud, and therefore a single SAP Customer Data Cloud API key and a single user database.

To set up this configuration:

  1. In the SAP Customer Data Cloud console, set up your master site.
  2. If you are using sub-domains for your sub-sites, define them as Trusted URLs using wildcards (see Trusted URLs).
  3. In the WordPress dashboard of your master site, install the SAP Customer Data Cloud plugin as described above.

(B) Each site has a separate domain:

This configuration is possible if you use one of the available third-party plugins for WordPress that map your sub-domains to different base domains. The sites will share a single user database.

To set up this configuration:

  1. In the SAP Customer Data Cloud console, set up each site separately, so that each site gets its own SAP Customer Data Cloud API key.
  2. Define the sites as a site group, with the base domain as the master site, and connect the sites via SAP Customer Data Cloud's Single Sign-On feature. Please contact your SAP Customer Data Cloud Customer Data Cloud Implementation Consultant to configure Site Group and SSO for you.
  3. In the WordPress dashboard of your master site, install the SAP Customer Data Cloud plugin as described above.
  4. Enable the SAP Customer Data Cloud plugin in all your individual sites using Network Enablement.
  5. In each site's WordPress dashboard, change the SAP Customer Data Cloud API key to the key of the specific site. You may change other settings, such as language, if required for your installation.

In this configuration, deleting a user from one of the sub-sites does not remove that user from the shared database. The user is simply disconnected from the specific sub-site. To remove a user from the database, delete the user from the network panel.

Note also that when adding a new sub-site, the SAP Customer Data Cloud plugin settings are copied from the master site into the sub-site, but you have to save the plugin settings once in order to activate them.

In both of these configurations, the user database is shared between sites in the multi-site installation. If you want to use one of the available WordPress plugins to help you keep separate user lists for your sites, be advised that this capability has not been tested for use with SAP Customer Data Cloud, and the users may not be synchronized perfectly with the SAP Customer Data Cloud database.

Troubleshooting

  • The server clock must be set to GMT+0, otherwise errors and unexpected behaviors may occur. We recommend using NTP daemon to ensure that the server time is accurate.
  • SAP Customer Data Cloud screen-sets must entirely replace any login, registration, etc., screen provided by the CMS. The CMS registration, login and edit profile screens should not be rendered at all. Otherwise, the SAP Customer Data Cloud screen is placed inside the CMS screen and both will behave unexpectedly.
  • After changing the value of the application key, you must re-enter the application secret.

End Of File

⚠️ **GitHub.com Fallback** ⚠️