Synchronize user information

Last updated Friday, March 4, 2016 in Social Connected for Developer, Administrator
Keywords: Configuration

When a visitor logs in to your website, Social Connected receives and saves the user profile information from the social network. The module saves social profile information to the Sitecore user profile in the extranet domain and to the contact profile.

The module receives the user profile information in two stages:

  • When a website visitor enters their social network credentials, the module receives basic data from the social network: ID, email, application key, application secret, access token, and access token secret. The module uses this information to identify the visitor.
  • When a visitor is identified, the module receives all the information that the visitor has allowed to share from the user profile on the social network. As a result, this information is received later than the basic data.

However, you can configure the module to receive all the user information simultaneously. Use the Login method of the Sitecore.Social.Client.Common.Helpers.LoginHelper class:

void Login(string networkName, bool updateSocialProfileAsync, Dictionary<string, object> additionalParameters, string callbackUrl = null);

where the updateSocialProfileAsync parameter is set to False.

By default, the module is configured to synchronize user information on login, once every two (or more) days. If a user logs in to your website one day after the last synchronization, the information is not synchronized, however, it is synchronized the next time the user logs in after two or more days have gone by.

You can configure Sitecore to synchronize user information every time the user logs in, or you can define the number of days after which you want it to synchronize.

Note

To update social profiles attached to a contact, the Synchronize Social Media Info agent locks the contact for the update, either during an online visit or by other processes. In this case, the Synchronize Social Media Info agent skips the social profile update until the contact is unlocked.

The lock period is specified in the Social.Profile.ContactLeaseDuration setting of the Sitecore.Social.config file. The default value of the lock period is 1000 milliseconds. If you are experiencing issues with updating social profiles due to lock-time expiration, increase the lock period.

This topic outlines how to:

  • Synchronize user information every time a user logs in
  • Synchronize user information after a specified number of days

Synchronize user information every time a user logs in

To get the latest information from the social network profile every time the user logs in to your website:

  1. In the website\app_config\include\social\sitecore.social.config file, in the settings section, set the Social.ProfileUpdating.Enabled setting to true.
  2. In the Social.ProfileUpdating.DaysBeforeExpiration setting, set the value to 0.

Synchronize user information after a specified number of days

To get the latest information from the social network profile, you can set the value to a certain number of days regardless of when the user logs in:

  1. In the website\app_config\include\social\sitecore.social.config file, in the settings section, set the Social.ProfileUpdating.Enabled setting to true.
  2. In the Social.ProfileUpdating.DaysBeforeExpiration setting, set the value to the number of days after which the module synchronizes the user information with the social network. For example, if the value of this setting is 2, the module synchronizes user information every two days when the scheduling agent runs.
  3. In the scheduling section, in the Sitecore.Social.Client.Tasks.SynchronizeSocialMediaInfo agent, set the interval value:
    <!-- The agent that synchronizes data with social networks. -->
    <agent type="Sitecore.Social.Client.Tasks.SynchronizeSocialMediaInfo, Sitecore.Social.Client" method="Run" interval="00:00:00" />

Send feedback about the documentation to docsite@sitecore.net.