Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Show If
groupgigya

Anchor
datasource.lookup.gender
datasource.lookup.gender

Include Page
Template Internal Notice Box 3 Do Not Share Basic
Template Internal Notice Box 3 Do Not Share Basic

Expand
titledatasource.lookup.gender

This script is used to guess the gender of a user in a third-party platform, based on the first name field in Gigya's platform. It returns the guessed gender and the probability for guessing correctly. The script may be used, for example, when running a targeted gender-specific campaign, to send emails only to those users who have are estimated with high certainty to belong to that gender.

For more information, see Internal - Gender Estimation Guide

When using this script, make sure to only return the delta of users for whom the gender has not been guessed (according to the example below), and not to query the entire user database each run.

RequiredParameter NameTypeDefaultDescription
Yes
firstNameFieldstring The Gigya field from which to take the user's first name.
Yes
targetFieldstring The field to populate with the guessed gender.
No
maxConnectionsinteger5The maximum number of connections that can be opened concurrently. Accepts values between 1 and 100.

The script returns a guessedGender object as custom Gigya data fields: data.guessedGender, for example:

  • data.guessedGender.gender="male"
  • data.guessedGender.probability="0.99". Probability ranges from 0 to 1.

 

Tip
titleExample

Following is an example of using this lookup to write the guessed gender to a custom Gigya data field:

Code Block
 {
      "id": "",
      "name": "Gender guess",
      "description": "accountRead > gender> remove> accountWrite",
      "steps": [
        {
          "id": "accountRead",
          "type": "datasource.read.gigya.account",
          "params": {
            "select": "UID, profile.firstName",
            "where": "profile.firstName IS NOT NULL AND profile.gender IS NOT NULL AND data.guessedGender IS NULL"
          },
          "next": [
            "genderGuess"
          ]
        },
        {
          "id": "genderGuess",
          "type": "datasource.lookup.gender",
          "params": {
            "targetField": "data.guessedGender",
            "firstNameField": "profile.firstName"
          },
          "next": [
            "remove"
          ]
        },
        {
          "id": "remove",
          "type": "field.remove",
          "params": {
            "fields": [
              "profile"
            ]
          },
          "next": [
            "accountWrite"
          ]
        },
        {
          "id": "accountWrite",
          "type": "datasource.write.gigya.account"
        }
      ]
    }

Include Page
Template Internal Notice Box 5 Footer End Of Internal Content
Template Internal Notice Box 5 Footer End Of Internal Content

Anchor
datasource.lookup.gigya.gm
datasource.lookup.gigya.gm

...