Drupal 7

Skip to end of metadata
Go to start of metadata

 

Overview

The GConnector is a module for Drupal 7 allows you to easily integrate Gigya's Registration-as-a-Service in your Drupal site. With the GConnector, you can easily implement such features as registration, authentication, profile management, data analytics and third-party integrations. Increase registration rates 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. 

Registration-as-a-Service (RaaS) is a premium platform that requires separate activation. If RaaS is not part of your site package, please contact Gigya by filling in a support form. You can access the support page by clicking Support on the upper menu after logging into your Gigya Console.

Main Features

  1. Customer Identity Management - Gigya offers a complete Customer Identity and Access Management (CIAM) solution for managing a new generation of user data that encompasses social identity data, social graph connections, behavior data, and traditional profile data. The GConnector for Drupal 7 provides two main packages:

    • Social Login - The Gigya module can be used as an external authentication system, allowing users to sign up to your site using an increasing number of platforms, such as Facebook, Twitter, Google, LinkedIn, Yahoo, and more. As with standard registration, new Drupal user accounts will be created in the process. See our documentation for additional information and advanced implementation options: Social Login.

    • Registration-as-a-Service(RaaS) - An end-to-end user management system package. The platform offers a comprehensive cloud-based user registration system that supports Social Login, allowing sites to maintain a unified user database for both social and traditional site authentication. Learn how to implement RaaS within Drupal. For additional information and advanced implementation options: Registration-as-a-Service.
  2. Personalized Content - Data provided through Gigya's Customer Identity Management solution can be passed to the Acquia Lift Drupal Module allowing dynamic personalized content management on Drupal websites. For technical information on how to install and use Acquia Lift, please visit the Acquia Lift Documentation. To configure field mappings between Gigya and Drupal, refer to Mapping RaaS Fields to Drupal Fields.

  3. Share - The module includes different tools to enable your users to share content and site activities to social networks. The Share Bar plugin displays a bar of buttons, next to whatever content you wish, for sharing this content to social networks and bookmark destinations. Sharing an action lets the site owner configure rules to automatically prompt the user with a share dialog, once he performs a certain share-worthy activity on your site, encouraging the user to post his action to social networks. The activity can be for example, posting a story, or submitting a comment, etc. See our documentation for additional information and advanced implementation options: Sharing Content.

  4. Comments - Gigya's Comments plugin enables site users to post comments and have discussions about published content on your site. These comments can be easily shared with social networks. By default, enabling Gigya comments will replace Drupal’s comments with Gigya’s. Gigya’s comments are configured to also be saved as Drupal comments, so the plugin can be easily be switched off - while still retaining the comments.

  5. Ratings & Reviews - The R&R plugins give your customers an easy way to provide feedback on product and content across your site, and then share that feedback with friends in their social networks. With Ratings & Reviews users can post reviews on any type of content displayed in your website, as well as rate the content on a 5 star scale.

  6. Reactions - The Reactions plugin allows users to react to content in your site and share their reaction to social networks. The Reactions plugin is built out of one or more buttons, arranged in a bar. Each button represents a "reaction" to the content, such as 'LOL', 'Amazing', etc. Once a user clicks on a reaction button, a share dialog will pop up to suggest to him to share his reaction to social networks.

  7. Gamification (GM) - Gigya's Loyalty - Gamification and User Behavior is a social loyalty and rewards platform that can be easily embedded in your website, increasing site engagement and making your users' experience more enjoyable.

  8. Activity Feed - This plugin is deprecated. If you are currently using it in your implementation, it must be disabled to prevent errors.

  9. Administration & Configuration - All features and user interfaces are fully configurable, require little time to install and can be controlled from your Drupal site administration.

Versions and Compatibility

Recommended Version

Download the GConnector for Drupal 7 from the Drupal directory at https://www.drupal.org/project/gigya (at the bottom of the page, click on the latest version for Drupal 7), uncompress and save it in the modules folder of the Drupal root folder.

View update details on the latest and earlier versions in our change log.

Legacy - Drupal 6

If your site uses Drupal 6, download our latest version for Drupal 6 at http://drupal.org/node/1515084. For details, see Gigya for Drupal 6 documentation.

Installation and Implementation

Adding the GConnector for Drupal 7 is easy. Each of the four simple steps is explained below in detail.

Your API keys will be quickly validated and your site will be ready to add Gigya's social features.

GConnector uses the user's email as a main identifier. Make sure to have permission to retrieve user emails as described here.

1. Install the Required Drupal Modules

Gigya requires the following modules be installed on your site in order to be enabled.

If you do not have them installed on your site, go to each of the links above and install them. Installation is quite similar to the installation of Gigya's module. You can follow the same steps or use Drupal's module installation guide.

2. Enable the Encrypt Module (OPTIONAL)

The GConnector provides the option of encrypting your Gigya credentials for added security.

To have your Gigya credentials encrypted, you need to enable the Encrypt module first, as follows:

  1. In the Drupal admin, go to the Encrypt module settings (Configuration > System > Encrypt).
  2. Select Add Configuration.
    Click to enlarge screenshot
  3. Insert a Name for the encryption configuration, e.g. Gigya_Encrypt. Note: Once you enter a name, the window will display the machine version of the name for your information. Copy or write down the machine name for use in Step 5.
    Click to enlarge screenshot
  4. If you want, you can add a description, e.g. "The encryption key for Gigya application secret".
  5. Go to the General Settings tab and check Enabled.
    Click to enlarge screenshot
  6. Go to the Encryption Method Settings tab and choose an encryption option (any option will work except for "None").
    Click to enlarge screenshot
  7. Go to the Key Provider Settings tab and choose whether to save the encryption key as an environment variable or as a file. If you choose a file, enter the path in the Path to Key field (the file can also be saved outside of the webroot).
    Click to enlarge screenshot
  8. Select Save Configuration.
  • Note that any changes you make later in the Encrypt module will not change Gigya's encryption functionality. For example, changing the encryption method settings will not change the way the Gigya Secret is saved in the database.
  • If you change settings that are related to the encryption key, such as the folder path, or re-generate the key, you may need to re-enter your application key and secret in the CMS configuration settings.

3. Download and Install the Gigya Module for Drupal

For downloads and more information: Gigya module page in the Drupal directory

There are three ways to install the Gigya module on your Drupal site:

  1. By feeding Drupal's module installer a URL to the latest compressed module file.
  2. By downloading the file and uploading it to the module installer.
  3. By directly uploading the module to your site.

While the module installer is much more user friendly, it will not work on all servers. Uploading it directly to your site requires direct access to the files on your host.

Regardless of the installation method that you select, It is recommended to download the latest release.

The Gigya Module for Drupal requires mod_curl to be active on Apache before installation.

4. Enable the GConnector

Enabling a module is done by checking the checkbox on the right of the module and clicking the Save configuration button.

Note that the GConnector requires a few other modules to be enabled before you can activate it. Every module lists the modules that it depends at the bottom of the cell, and their status to assist you in activating it.

Click to enlarge screenshot

5. Enter Your Gigya Keys

To start using the GConnector, you must provide your Gigya credentials.

First, choose which credentials you want to use:

  • Option #1 (BEST PRACTICE): Gigya API Key + Application Key + Application Secret. A Gigya Application Key is a key that you create specifically for your Drupal implementation. Using it helps to protect your Gigya data.
  • Option #2: Gigya API Key + Gigya Secret: Another, less recommended option is to use your general Gigya Secret.

To enter your Gigya keys, do the following:

  1. Obtain your keys:
    • To obtain the Gigya API Key, log into the Gigya console and navigate to the home screen. Your site's API key will appear in the API key column next to your site's domain.
      Click to enlarge screenshot
    • If you chose to use an App Key + App Secret, see instructions for creating an Application Key .
    • If you chose to use your Gigya Secret, log into the Gigya Console, select your site domain from the drop-down menu titled Select your site: at the top of the window, and click show secret key.
      Click to enlarge screenshot
  2. In the Drupal admin, go to Configuration > Web services > Gigya Settings.
  3. Select the Gigya Socialize Keys Settings tab, and inside the tab, click the Gigya Socialize Keys box to expand it. The following options are displayed:
    Click to enlarge screenshot
  4. Under Access Mode, choose Gigya Secret Key or Gigya Application Key.
  5. In the input fields that are displayed, enter your Gigya API Key + Gigya Secret or your Gigya API Key + Gigya Application Key + Gigya Application Secret.

    For security reasons, access to the Gigya Secret Key is limited by user permission:

    • Users with the Gigya Major Admin permission see the first and last two characters and can edit the key.
    • Other users of the page see a note saying "The secret key can only be accessed by authorized users".

    The Gigya Secret Key is never displayed in full.

  6. If you have enabled the Encrypt module, select the configuration you created in the Encrypt Machine Name dropdown.
  7. Select your site's Gigya Data Center from the drop-down list. You can see your Data Center in the Gigya console:
    Click to enlarge screenshot
    The options are:
    • US (US data center) - default
    • EU (European data center)
    • AU (Australian data center)
    • Other: this option is provided to accommodate new data centers that Gigya may add before the next version of the Gigya Module for Drupal is released. If you are using a different data center, enter its <Data_Center> in the box provided.
      Where <Data_Center> is:
      • us1.gigya.com - For the US data center.
      • eu1.gigya.com - For the European data center.
      • au1.gigya.com - For the Australian data center.
      • ru1.gigya.com - For the Russian data center.
      • cn1.gigya-api.cn - For the Chinese data center.

      If you are not sure of your site's data center, see Finding Your Data Center.


       
  8. Select Save Configuration.

The Gigya module uses the user's email as a main identifier. Make sure to have permission to retrieve user emails as described here.

6. Set Up User Management

User Management Settings

After the GConnector is installed, it can be configured through the Admin Configuration Panel under the Gigya entry (Configuration > Web Services > Gigya Settings).

The User Management tab configures the part of the module that relates to user registration and management (RaaS and Social Login).

There are four basic options, and the settings displayed vary depending on the option you select:

  • Drupal only - This (default) option disables Gigya's login and Gigya's user management and uses Drupal's native login.
  • Drupal + Social Login - This option enables Gigya's social login, allowing users to login to your site using their social networks. User management is handled by Drupal.
  • Social Login only - This option enables Gigya's social login and disables Drupal's native login, allowing users to register and login using only their social identities.
  • Registration-as-a-Service - This option enables both Gigya's social login and Gigya's user management, giving you extended data and control over your site users and enabling the RaaS feature.

Click to enlarge screenshot

Drupal + Social Login (or Social Login only)

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

FieldDefault Description
Button styleStandard

This parameter enables selecting one of the pre-defined design styles for the network buttons on the Login UI.
Currently Gigya offers the following design styles:

standard (default)
fullLogo
fullLogoColored
signInWith
Post Login Redirect(no default)This parameter defines where the users will be redirected to once they have successfully logged in to the site.
You can enter any URL, or leave the field empty. If the field is left empty, the page will reload after the user logs in.
Hide titlenoHide login block title.
Show terms linkNoSelect Yes to display a link to the Gigya terms of use agreement.
Width210Specify the display width of the login plugin in pixels. Available after checking the Set custom size for plugin button.
Height110Specify the display height of the login plugin in pixels. Available after checking the Set custom size for plugin button.
Advanced ShowLoginUI Settings(no default)This box enables you to specify configuration options beyond those available in the fields above. For details, refer to the Advanced Settings section. For the list of available configuration options, refer to parameters table in the socialize.showLoginUI API page.
Advanced ShowAddConnectionsUI
Settings
(no default)This box enables you to specify configuration options beyond those available in the fields above. For details, refer to the Advanced Settings section. For the list of available configuration options, refer to parameters table in the showAddConnectionsUI API page.

Enabling Social Login activates the Login plugin. The Login plugin appears on the Drupal User Login block, alongside the standard Drupal login form, as seen in the screenshot.The login plugin will also appear in the Drupal login and registration page when navigating to {your site domain}/user - e.g www.mydrupalsite.com/user.

You can use the Login plugin to customize the sign-in options within your site, as explained in the table above.

For more information on the Login plugin, you can refer to the Login plugin page and to the socialize.showLoginUI API method.

Click to enlarge screenshot

RaaS Settings

To implement Gigya RaaS, see Using RaaS with Drupal.

7. (Optional) Implement Gigya Plugins

To implement Gigya Plugins, see Using Gigya Plugins in Drupal.

Customization

To configure module settings, go to the Admin Configuration Panel under the Gigya entry (Configuration > Web Services > Gigya Settings) and select one of the settings tabs.

UID-Based Sync

Data sync between Gigya and the CMS is based on Gigya'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 the CMS when installing the GConnector. When configuring Gigya for CMS integrations, the email is always the login identifier (included in the loginID). 

We differentiate between two types of CMS: 

  • Email is required and unique (a user identifier in the CMS).
  • Username is required and unique (a user identifier in the CMS).

When Email is the CMS Identifier

When the user's email is an identifier in the CMS, by default, the CMS email field is mapped to the emails stored in Gigya's loginID. This cannot be overridden by field mapping. 

The login/registration flows in this case require that at least one email that is recognized in Gigya as a login identifier is unique to the user. After a user logs in or registers, the flow is as follows:

  1.  Following Gigya's onLogin event, the UID is passed. 
  2. The GConnector checks if the UID exists in the CMS database: 
    • Login: If the UID exists in the database, the system makes sure that at least one of the emails in the loginID is unique to this user, logs the user in and sets that email address in the CMS. If all of the user's loginID emails are saved to other users (other UIDs), the user will not be logged in, and will receive an error.
    • Register: If the UID does not exist, the system makes sure that at least one of the emails in the loginID is unique to this user, registers a new user and sets that email address in the CMS. If all of the user's loginID emails are saved to other users (other UIDs), the user will not be logged in, and will receive an error.

If you are using the profile.email Gigya data field, it should be mapped to a custom email field in the CMS, and not to the default required email field in the CMS.

When Username is the CMS Identifier

  1.  Following Gigya's onLogin event, the UID is passed. 
  2. The GConnector checks if the UID exists in the CMS database: 
    • Login: If the UID exists, the user is logged in. Data is updated according to this flow (required fields are updated before non-required).
    • Registration: If the UID does not exist, a new user is registered in the CMS. Data is saved according to this flow (required fields are updated before non-required).

Changing the Sync Base and Backward Compatibility

In Drupal 7, email is a required field, and serves as the identifier. By default, the GConnector for Drupal 7 syncs identity data between Gigya and Drupal based on the UID. The connector is backward compatible and behavior of older versions of the module does not change automatically, and if you wish to change the behavior, you should consult with your Account Manager for a migration plan. All users should have a Gigya UID before migrating to a UID-based sync. Therefore, we advise that you first check your Drupal user database to search for users which lack a Gigya UID. To locate any such users, run the following SQL query: 

SELECT uid FROM users WHERE uid NOT IN (
SELECT duid FROM gigya_ids INNER JOIN users ON gigya_ids.duid = users.uid)

The query returns any user for whom a UID is not defined. The search will always return the user "0". Note that admin users who are assigned the Bypass-Registration-as-a-Service permission are not assigned a Gigya UID, so if the search returns any users in addition to the "0" user, check to see whether they have admin permissions. 

 

To change the sync base of the connector, a PHP developer should set the value of the gigyaSyncBase variable:

  • GigyaUID (default for new installations) - the sync base is Gigya's UID.
  • LoginIDsEmail - the sync base is the email saved in the loginID and Drupal's email identifier.

For example, to change the sync base to Gigya's UID, run the following PHP script.

variable_set('gigyaSyncBase', 'GigyaUID');

Global Settings

The settings in this section define basic configurations of the Gigya integration on your Drupal site.

FieldDefaultDescription
Providers*

Enter a comma-separated list of social network and other login providers that you want to enable for the site users. The default * setting enables all available providers. For the list of available providers, see Global Configuration.

RaaS Screen-Set LanguageDrupal Page Language

Select the language to be used in Gigya RaaS screen-sets. If you select Drupal page language, each screen-set will use the language that was set in Drupal for the containing page.

For information about the languages supported by Gigya, see Advanced Customizations and Localization.

Drupal Page Language FallbackEnglishIf you selected Drupal Page Language in the field above, the fallback language will be used if the Drupal page language is not one of the languages offered by Gigya.
Enable Google Social AnalyticsNoCheck this checkbox to enable the Google Social Analytics plugin. For details, refer to the Third-Party Analytics Integration page.

Login Behavior

(Deprecated)

Login existing userFor users not logged into the site, this field determines login requirements for performing a Gigya social action (for example, sharing, reacting, or commenting).
  • Always login – before proceeding with the Gigya social action, users are first directed to site login.
  • Login existing user (Default) – 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.
Session ManagementGigyaSee the Session Management section below for details.
Gigya advanced settings(no default)

See the Advanced Settings section below for details.

Remember to click the Save Configuration button before continuing.

Session Management

This setting applies only if you are using RaaS.

You can choose which platform controls the login sessions: Gigya or Drupal. The selected platform will determine whether the user is logged in or not.

If Gigya is selected (default):

  • Whenever a user logs in through Gigya, the Drupal login event is initiated as well, so that the user is logged into Drupal.
  • When the Gigya session expires, the user is also logged out of Drupal.
  • On every page load, Drupal checks if the user is logged into Gigya or not, and takes action as follows:

    Logged into Drupal?Logged into Gigya?Action
    -
    Log user out of Drupal
    Log user into Drupal
    -

If Drupal is selected:

  • When logging in through Gigya, the Drupal login event is still initiated and the user is logged into Drupal. However, if there is a problem and the user is not successfully logged into Drupal for some reason, the user will be logged out of Gigya.
  • When logging out through Gigya, the user is also logged out from Drupal.

  • The Gigya session length is set based on the Drupal session lifetime setting, so that the two sessions expire simultaneously.

To enable SSO (Single Sign-On), sessions have to be controlled by Gigya. If you select Drupal in this setting, SSO will not function correctly.

Advanced Settings

Most of the Gigya settings tabs include an Additional Parameters or Advanced Settings box. This box enables you to specify configuration options beyond those available in the other fields for that tab. For the list of available configuration options, see Global Configuration.

Click to enlarge screenshot

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

The following example demonstrate defining the values for the enabledProviders and ShortURLs parameters:

{
    "enabledProviders":"facebook, twitter",
    "shortURLs":"whenRequired"
}

Note:

  • What you specify in Additional Parameters/Advanced Settings will override anything you specify in the settings for that section, and must be used carefully.
  • In the JSON object, you can not enter JavaScript functions as parameter values. Supported value types are integer, string, and Boolean.
  • The Additional Parameters block cannot include events. or hooks.

Advanced Customization

Further customization is possible through the use of Hooks and Tokens. Read more in Advanced Customization.

Roles and Permissions

Users of the module who hold the Administrator role in the Drupal system are granted the following Gigya permissions:

  • Administer Gigya - Access to Gigya settings and configuration.
  • Bypass Registration-as-a-Service - Admins use Drupal's standard login/user systems instead of Gigya's login and RaaS.
  • Gigya Major Admin - Access to the Gigya Secret Key. Users without this permissions cannot see this key.
  • Use TOKENS string input for field settings - Ability to enter TOKENS strings in certain field settings that allow it.

Other users of the module do not receive any of these Gigya permissions by default. Administrators may choose to create a role such as Gigya Editor, configure it with some or all of the Gigya permissions listed above, and assign the role to certain users.

For more information, see Setting Up Admin Roles in the Using RaaS with Drupal page.

Customer Insights Notifications

Customer Insights (CI) is where you as a site owner can analyze information regarding your users' engagement and activity. View the CI reports in the customer insights page of your Gigya admin console.CI works by binding signals to counters. The signal triggers the increment of the counter, which is then represented in the corresponding CI report. There are a few default counters that need no prior configuration to collect data. You can also define custom counters to track specific signals that are not counted by default.

Adding Custom CI Notifications

Custom CI counters use the rules module installed. Download, install and enable the module if you have not done so yet.

  • Once you have the module set up, go to Configuration > Workflow > Rules.
  • On the rules page, click from the to left side of the page.
  • Next you will arrive at the new rule page where you will have to select a name and an event to trigger your event:

Click to enlarge screenshot

  • You can name your rule freely, however note that the event you select will be responsible for triggering a signal that will increment the counter that you will bind to in the next step. Make sure to choose an event that represents the counter you wish to increment through it.
  • After selecting an event you will get a drop-down menu that enables you to limit the event signals to specific pages.

Click to enlarge screenshot

This can help you fine tune the signals that trigger your counter, although it is not required.

  • Available counters that are not incremented automatically are:
    • Ad click
    • Purchase

You can also create custom counters via an API call to accounts.registerCounters.

  • Then define the action to be performed as the signal triggers. On the next page click Add Action from the Actions section at the bottom of the page. You will be redirected to the Add new action section where you will need to select an action from the drop-down menu.
  • From the drop-down, select Notify Gigya signal from the Gigya section.

Click to enlarge screenshot

  • The Last step is to configure the counter for the signal you have created. The next page enables you to define the counter parameters:
    • Class
    • Path
    • Value
    • Count (Signal count)

When finished, click Save to complete the process and start tracking user actions on your site. Go to the Customer Insights section in your console to query the data.

Newly added Classes and Paths appear only after the cache is cleared.

Extended Features

Multi-Site Support

In a multi-site implementation of Gigya with Drupal 7, your sites share the same database, as they normally do with SSO (Single Sign-On). 

The GConnector for Drupal 7 supports multi-site installations via the Domain Access module. Download and install the module according to its documentation. 

  1. Under the Domain Access settings in Drupal, make sure the following are checked (the first two should be checked by default and are greyed out): Domain Access, Domain Configuration, Domain Settings
  2. In the Gigya Socialize Key Settings tab, you should now see the new Domain-Specific Settings field-set. To configure the global settings, make sure All domains is selected
  3. Expand the Gigya Socialize Keys box. Enter the Gigya API key and the Gigya secret key, or application key and application secret, and encryption details, as detailed above.
  4. Save the configuration for the global settings. 
  5. Select the next site for which to configure the API key and secret, and enter its relevant settings. 
  6. Save the configuration. 

Logs and Debugging

To view runtime information, enter Drupal.settings.Gigya in the site console. In addition you may use Gigya's various Debugging Tools.

Logs are available in two modes:

EventsRegular Mode (Debug Off)Debug Mode
Errors in API calls to Gigya

Logged along with the native error message

Logged along with the native error message

Gigya Secret or App Secret changed
Every call to Gigya API 

To switch between regular mode and debug mode:

  1. In the Drupal admin, go to Configuration > Web Services > Gigya Settings.
  2. In the Global Settings tab, expand the Advanced Gigya Settings panel.
  3. Check or uncheck the Gigya debugging checkbox.

Troubleshooting

General

  • 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.
  • Gigya 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 Gigya screen is placed inside the CMS screen and both will behave unexpectedly. 
  • After changing the value of the application key, you should re-enter the application secret.

Save

Save

Save

Save

Save

Save