Gigya Job Openings

Page History

Versions Compared

Key

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

...

Expand
titledatasource.write.hybrismarketing

Write data to the SAP Marketing Cloud platform (previously Hybris Marketing). For the full guide for setting up the implementation, see SAP Marketing Cloud

RequiredParameter NameTypeDefaultDescription
Yes
contactFieldstring The field that contains the unique identifier(e.g: Gigya's UID).
Yes
endpointstring The SAP Marketing Cloud authentication endpoint.
Yes
passwordstring The SAP Marketing Cloud password.
Yes
usernamestring The SAP Marketing Cloud user name.
No
batchSizeinteger 

The maximum number of records to write. Accepts values between 1 and 50. The default is 1.

No
emailFieldstring The name of the Gigya field that contains the contact's email. The value is mapped to the "ContactPermissionID" field in SAP Marketing Cloud.
No
marketingAreaFieldstring The name of the Gigya field that contains the marketing area information. The value is mapped to the "MarketingArea" field in SAP Marketing Cloud.
No
mobileFieldstring The name of the Gigya field that contains the contact's mobile phone number. The value is mapped to the "MobileNumber" field in SAP Marketing Cloud.
No
timeoutinteger The timeout (in seconds) to wait for a response from SAP Marketing Cloud.
No
subscriptionsarray of objects 

An array of JSON objects that contain the subscription properties:

  • newsletterField (string): The Gigya field to use for subscription status
  • communicationCategory (string): The Marketing Cloud Communication Category ID

To include a period in the name of the target field, surround the field name with single apostrophes. For example:

Code Block
"subscriptions":[
      {
        "newsletterField":"subscriptions.sub1.email.isSubscribed",
        "communicationCategory":"41"
      }
    ]
No
consentarray of objects 

An array of JSON objects that contain the consent properties:

  • consentField (string): The Gigya field to use for the consent status
  • communicationMedium (string): The marketing cloud communication medium. The default value is "EMAIL". Acceptable values: "EMAIL", "FACEBOOK", "GOOGLE_ADS", "YOUTUBE", "INSTAGRAM", "SMS", "PHONE".
  • communicationType (string): Marketing cloud communication medium type. The default value is "EMAIL". Acceptable values are "EMAIL" and "MOBILE".

To include a period in the name of the target field, surround the field name with single apostrophes. For example:

Code Block
"consent":[
      {
        "consentField":"preferences.terms.isConsentGranted",
        "communicationMedium":"EMAIL",
		"communicationType" : "EMAIL"
      }
    ]
No
maxConnectionsinteger1The maximum number of connections that can be opened concurrently. Accepts values between 1 and 100.

Following is a sample dataflow that reads subscription data (from the 'emailAccounts' namespace) and preferences data (from 'accounts') for full accounts saved in Gigya, and writes the data to SAP Marketing Cloud:

Code Block
languagejs
linenumberstrue
{
 "name": "Hybris_Marketing_Dataflow_Outbound",
 "description": "account > lookup > rename > field.evaluate > remove >  hybrismarketing",
 "steps": [
  {
   "id": "account",
   "type": "datasource.read.gigya.account", // Reads user subscription data 
   "params": {
    "select": "UID,profile,lastLoginLocation,subscriptions",
    "batchSize": 50,
    "from": "emailAccounts",
    "deltaField": "lastUpdatedTimestamp",
    "maxConcurrency": 1,
   },
   "next": [
    "lookup"
   ]
  },
 {
   "id": "lookup",
   "type": "datasource.lookup.gigya.account", // Reads user preference data
   "params": {
    "select": "UID,preferences",
    "handleFieldConflicts": "take_source",
    "mismatchBehavior": "process",
    "lookupFields": [
     {
      "sourceField": "UID",
      "gigyaField": "UID"
     }
    ],
    "lookupFieldsOperator": "OR",
    "isCaseSensitive": true,
    "from": "accounts",
    "batchSize": 200,
    "maxConcurrency": 1
   },
   "next": [
    "rename"
   ]
  },
  {
   "id": "rename",
   "type": "field.rename", // Renames fields from Gigya's format to SAP Marketing Cloud's format
   "params": {
    "fields": [
     {
      "sourceField": "profile.email",
      "targetField": "EmailAddress"
     },
     {
      "sourceField": "profile.firstName",
      "targetField": "FirstName"
     },
     {
      "sourceField": "profile.lastName",
      "targetField": "LastName"
     },
     {
      "sourceField": "profile.gender",
      "targetField": "GenderCode"
     },
     {
      "sourceField": "profile.country",
      "targetField": "Country"
     },
     {
      "sourceField": "profile.city",
      "targetField": "CityName"
     },
     {
      "sourceField": "preferences.perf1.isConsentGranted",
      "targetField": "consentField"
     },
     {
      "sourceField": "subscriptions.sub1.email.isSubscribed",
      "targetField": "newsletterField"
     }
    ]
   },
   "next": [
    "field.evaluate"
   ]
  },
  {
   "id": "field.evaluate",
   "type": "field.evaluate", // Transforms field values to match the format in SAP Marketing Cloud
   "params": {
    "fields": [
     {
      "field": "GenderCode",
      "expression": "GenderCode eq 'm' ? '1' : (GenderCode eq 'f' ? '2' : null)" // Transforms gender values from "m" and "f" to "1" and "2"
     },
     {
      "field": "BirthDate",
      "expression": "profile.birthYear && profile.birthMonth && profile.birthDay ? profile.birthYear + '-' + (size('_' + profile.birthMonth) == 2 ? '0' : '') + profile.birthMonth + '-' + (size('_' + profile.birthDay) == 2 ? '0' : '') + profile.birthDay + 'T00:00:00' : null" // (1) Aggregates 3 birthday fields to one (2) Adds a "0" to 1-digit months (3) Adds a "00..." timestamp of hours, minutes and seconds
     },
     {
      "field": "IsConsumer",
      "expression": "true"
     },
     {
      "field": "Longitude",
      "expression": "lastLoginLocation.coordinates.lon ? lastLoginLocation.coordinates.lon.toString() : null" // Transforms the longitude field from integer to string
     },
     {
      "field": "Latitude",
      "expression": "lastLoginLocation.coordinates.lat ? lastLoginLocation.coordinates.lat.toString() : null" // Transforms the latitude field from integer to string
     },
     {
      "field": "YY1_LiteFullRegistr_MPST", // Sets a "F" (for "full account") value to a custom field in Hybris that indicates whether users are full or lite. Use this only if your implementation includes Lite Registration.
      "expression": "'F'"
     }
    ],
    "language": "jexl"
   },
   "next": [
    "remove"
   ]
  },
  {
   "id": "remove",
   "type": "field.remove",
   "params": {
    "fields": [
     "profile",
     "lastLoginLocation",
     "preferences",
     "subscriptions"
    ]
   },
   "next": [
    "yMarketing"
   ]
  },
  {
   "id": "yMarketing",
   "type": "datasource.write.hybrismarketing",
   "params": {
    "username": "...",
    "password": "...",
    "endpoint": "...",
    "contactIdField": "UID",
    "maxConnections": 10,
    "emailField": "EmailAddress",
    "consent": [
     {
      "consentField": "consentField",
      "communicationMedium": "EMAIL",
      "communicationType": "EMAIL"
     }
    ],
    "subscriptions": [
     {
      "newsletterField": "newsletterField",
      "communicationCategory": "41"
     }
    ],
    "timeout": 120,
    "batchSize": 50
   }
  }
 ]
}

...