Back

This article explains how to use the string data type. String attributes are used to store text values.

In this article:

Table of Contents Placeholder

How it Works

Before you begin, familiarize yourself with the following:

Strings are used in EventStream and AudienceStream to store text values. For example, strings are used for customer information such as First Name and Postal Code, order information such as Order ID and Shipping Method, or site information such as Site Section or Site Language.

The string attribute is available in the following scopes: Event, Visit, Visitor.

attribute-scopes-table-all.png

String attribute values have a maximum length of 1,000 characters.

String Enrichments

The following enrichments are available to string attributes.

Set String

This enrichment sets the value of a string attribute, either from a constant value you provide or from the value of another string attribute. The source values can only be a string, iQ variable, or Omnichannel attribute.

Attribute Name: customer_type

Starting Value  ""
Enriched With  "unknown"
Resulting Value  "unknown"

Split String

This enrichment allows you to set multiple values based on a distribution percentage. Each value you set also has a percentage setting. There can be multiple value/percentage entries, but the distribution must total 100%. The distribution is based on a random number generator, so smaller samples might not match the distribution, but as more values are assigned the distribution ratio will become more accurate. The source values can only be a string, iQ variable, or Omnichannel attribute.

In this example an attribute named test_group is used to segment users into two equal groups (50/50), one named "GroupA" and the other "GroupB". This attribute can then be used to identify activity associated with each group.

 

Attribute Nametest_group

Starting Value  ""
Resulting Value Set string's value to "GroupA" for 50% of string population
Set string's value to "GroupB" for 50% of string populartion

See also: Enrichment Example: Split String

Remove String

This enrichment removes the entire value from the attribute.

Starting Value  "Jane Smith"
Resulting Value  ""

Lowercase String

This enrichment will lowercase the current value of the string attribute.

Attribute Nameemail_address

Starting Value  "First.Last@Example.com"
Resulting Value  "first.last@example.com"

Join Attributes

This enrichment joins multiple values with a specified delimiter to form a single text value. The delimiter can one or more characters. For example, you could join the first_name and last_name attributes with a single space delimiter to create full_name attribute. You could also create a structured page hierarchy value by combining site_section, page_category, and other page level attributes.

Attribute Namepage_path

Starting Value  ""
Enriched With Attribute 1: site_region="en-us"
Attribute 2: site_section="Electronics"
Attribute 3: category_name="Tablets"
Delimiter: ":"
Resulting Value  "en-us:Electronics:Tablets"

Set String to Date

This enrichment converts the value of a string attribute to a date and allows for custom formatting (learn more about the data formatter). The source values can be a date, string, iQ variable, or file import attribute.

Attribute Name: last_purchase_date

Starting Value  ""
Enriched With  Last Login Date with format "yyy-MM-dd"
Resulting Value  "2019-12-31"