Send Profile Data

Developers can set up two ways for customers to send shopper profile attributes to Einstein: bulk upload and real-time activity tracking. You can use either method (or both) to send shopper profile data to Einstein.

When submitting data to Einstein, keep the following in mind:

  • Salesforce strongly recommends that you do not send personal identifiable information (PII) to Einstein other than the specified recommended user identifiers.
  • All collected data is stored internally for up to one year. At the one year mark, data is aged out and removed from all Einstein databases. To continue using this profile data, you must resend it to Einstein.
  • When updating data, make sure to upload all existing, unchanged data along with the most recent data changes. Newly uploaded data replaces any previously uploaded data based on the original upload method. For example, uploading new bulk profile data replaces existing bulk profile data, and uploading new real-time profile data replaces existing real-time profile data.
  • Einstein uses all profile data provided. New data is not valued any differently than existing data.

Salesforce offers a secure bulk upload endpoint for customers to upload any historical shopper profile data they have collected.

The bulk upload option is intended for:

  • Any shopper profile-related data that you have tracked and collected.
  • Any trusted third-party data that you want Einstein to use for added shopper personalization.

Uploading data in bulk can have a major impact on Einstein data. For this reason, we allow only authorized users to upload large quantities of data. In addition, each upload API call must pass a required authorization header (bearer) access token obtained from Account Manager.

Note: To reduce load on the Account Manager server, avoid generating any new tokens until the current token expires. Refer to the API Specification for more information on bulk upload API calls.

To prepare bulk upload data for Einstein consumption, ensure the following:

  • The bulk file is a gzipped tab-separated values (TSV) file.
  • The TSV file is properly formatted and saved using UTF-8 character encoding.
  • The mimetype of the file is set correctly for use by the gzip application.
  • The header row must contain the login_id identification field, email_address identification field, or both.
  • You can add additional columns for every shopper profile attribute that you want to send.
  • Values are either strings or lists of strings. For a list of strings, make sure to separate values using the pipe (|) separator. For example, orange|yellow.
  • Empty columns are ignored. When Einstein encounters an empty column, it skips that column and continues processing the remaining user attributes data.

To help generate relevant product recommendations for each shopper, the Profile Connector API needs either of these user identifiers for shopper identification in bulk upload.

FieldDescription
login_idShopper's login ID. In some cases this is the same as the email_address value.
email_addressShopper's full email address. For example, shopper1@somewhere.com.

Here is an example of shopper profile bulk upload TSV data with random column names:

login_idemail_addressgendercolorsbrand_list
shopper1shopper1@somewhere.commaleorange|yellowbrandA|brandB
shopper2shopper2@somewhere.comfemaleblue|blackbrandD
shopper3shopper3@somewhere.comfemalered|black|violetbrandB|brandE

When performing shopper profile bulk upload, keep the following endpoint limitations in mind:

  • You can upload only one file at a time. However, you can upload multiple files, one after another.
  • The maximum allowed file size is 2 GB.

After you prepare the shopper profile bulk data files, gzip each individual file and upload it to Einstein’s shopper profile bulk upload endpoint. For more information, refer to the Send bulk profile endpoint.

Use the activity updateProfile tracking endpoint to call and send real-time shopper profile data updates and preferences. Capturing information that a shopper provides in your storefront in real time enables recommendations to reflect these changes immediately.

The real-time activity tracking option is intended for:

  • Capturing shopper preference activities in real time.
  • Making shopper profile updates in real time.

To help generate relevant product recommendations for each shopper, the Profile Connector API provides two user identifiers for shopper identification in real-time tracking.

  • cookieId (required) - Unique identifier of an anonymous shopper. Typically, the cookieId is the value of a first-party cookie.
    • When making API requests from a traditional Commerce Cloud storefront, pass the cqcid cookie value to match the automatic activity tracking on the traditional storefront. For more information, see Browser-Based Local Data Storage.
    • When using OCAPI or the Salesforce Commerce API, use the visit_id value from the guest login response to match automatic activities. For more information, see the OCAPI Customer Document.
  • userId (encouraged) - Unique identifier of a logged-in shopper. This parameter enables Einstein to link the same logged-in user across multiple devices.
    • When making API requests from a traditional Commerce Cloud storefront, use the cquid cookie value to match automatic activity tracking on the traditional storefront. For more information, see Browser-Based Local Data Storage.
    • When using OCAPI or the Salesforce Commerce API, use the hashed_login value from the registered login response to match automatic activities. For more information, see the OCAPI Customer Document.

To avoid potential malicious activity, user identifier parameters must be non-sequential. The parameters should not include sequences, patterns, IP addresses, email addresses, names, or anything linked to a specific person. All user identifier parameters must comply with General Data Protection Regulation (GDPR) through hashing or other methods.