String group upload format and analysis description

更新时间:
复制 MD 格式

When reporting property values, you can report multiple values simultaneously. For example, a product type can be Mother and Child, Food, and Fruit. QuickTracking provides the string group type property to support such multi-value attributes. String groups are supported for event attributes, global attributes, and user attributes.

Note

String groups support only event attributes, global attributes, and user attributes

1 Scenario

When a user purchases a product, you need to track browsing, adding to cart, and checkout behavior. A common tracking solution is as follows:

Page name

Page encoding

Event Name

Event code

The attribute name.

Attribute key

Attribute type

Product page browsing

goods_page

Product page browsing

goods_page

Product Name

goods_name

String

Product Type

goods_type

String Group

The actual sales price of the item.

goods_price

Numeric

Shopping Cart Click

trolley_clk

Product Name

goods_name

String

Product Type

goods_type

String Group

The actual sales price of the item.

goods_price

Numeric

Settlement Click

pay_clk

Product Name

goods_name

String

Product Type

goods_type

String Group

The actual sales price of the item.

goods_price

Numeric

The "product type" is a string group because a product can belong to multiple types. For example, melon seeds:

commodity name: melon seeds

Product Type: Nuts, Snacks, Processed Foods

Commodity price: 12.00

When the tracking event is reported, "nuts", "snacks", and "processed food" must all be written to the attribute key "goods_type" simultaneously. This is a string group attribute. See the following sections for reporting and analysis methods.

2. Manage properties

Warning

Before reporting, register the attribute at least 15 minutes in advance. In the Data Collection > Tracking Point Management > Attribute Management module, set the attribute type to "string group". Otherwise, the data cannot be parsed.

image

image

3 Reporting Method

Warning

Before reporting, register the attribute at least 15 minutes in advance. In the Data Collection > Tracking Point Management > Attribute Management module, set the attribute type to "string group". Otherwise, the data cannot be parsed.

When reporting through the SDK, concatenate multiple property values into a string in the following format. If the data does not conform to this format, the system cannot parse it.

"String_arrayString": "['Nuts', 'Snacks']"
"String_arrayInt": "[1,2]"
"String_arrayBoolean": "[true,false]"

"String_arrayString": ["Nuts","Snack"]
"String_arrayInt": [1,2]
"String_arrayBoolean": [true,false]

Report format

Format processing

  • "['nut', 'snack']"

  • ["Nuts","Snack"]

Standard Report Format

  • "[1,2]"

  • [1,2]

Forcibly converted to the string group "['1','2']". This is an incorrect reporting format. Although the system is compatible with converting numeric values to strings, avoid reporting in this format.

  • "[true,false]"

  • [true,false]

Forcibly converted to the string group "['true','false']". This is an incorrect reporting format. Although the system is compatible with converting boolean values to strings, avoid reporting in this format. (Note: uppercase TRUE/FALSE is not supported.)

Use an Android custom event tracking point as an example:

Map<String, Object> goods = new HashMap<String, Object>();
goods.put("goods_name", "melon seeds");// Product name-melon seeds
goods.put("goods_type", "['nuts', 'snacks', 'processed food']"); // The type of the product.
goods.put("goods_price",12); // Price: CNY 12
QtTrackAgent.onEventObject(this, "pay_clk", goods, "goods_page");

or use the following method:

Map<String, Object> goods = new HashMap<>();
goods.put("goods_name", "melon seeds");// Product name-melon seeds
String[] type_property = {"Nuts", "Snacks", "Processed Food"};
goods.put("goods_type", type_property);// The type of the product. Valid values: nuts, snacks, and processed foods.
goods.put("goods_price", 12);// Price: CNY 12
MobclickAgent.onEventObject(mContext, "pay_clk", goods);

Use custom event tracking for iOS as an example:

NSDictionary *dict =@{@ "goods_name" : @"melon seeds", @"goods_type" : @"['nuts', 'snacks', 'processed foods']", @"goods_price" : @12};
[QTMobClick event:@"pay_clk" pageName:@"goods_page" attributes:dict];

or use the following method:

 [QTMobClick event:@"pay_clk" attributes:@{
                @"goods_name" : @"melon seeds",
                @"goods_price" : @12,
                @"goods_type": @[@"Nuts", @"Snacks", @"Processed food"]
            }];

Use a mini program to customize event tracking.

aplus.record('pay_clk', 'CLK', {
  goods_name: 'Melon See',
  goods_type: ['Nuts', 'Snacks', 'Processed food'],
  goods_price: 12,
  page_name: "goods_page",
});

Use Web/H5 custom event tracking as an example:

aplus.record('pay_clk', 'CLK', {
  goods_name: 'Melon Sedes',
  goods_type: ['Nuts', 'Snacks', 'Processed food'],
  goods_price: 12,
  page_name: "goods_page",
});

4 Analysis methods

Note

There are two types of string group analysis methods:

  • Single value: Each value in the string group is split and analyzed individually. For example, in ['nut', 'snack', 'processed food'], the single values are "nuts", "snacks", and "processed food". You can analyze any of these values independently.

  • Original value: The entire string group is analyzed as a whole without splitting. For example, the original value of the above example is "['nut', 'snack', 'processed food']".

4.1 supported analytical models

  1. Select a metric: You can select String Group Single Value as a metric in event analysis, attribute analysis, or crowd creation. Other analysis models support only the original value.

image.png

  1. Select a group: In event analysis, attribute analysis, and crowd creation, you can group by string group single value. Other analysis models support only the original value.

  2. You can filter by string group single value in event analysis, funnel analysis, distribution analysis, retention analysis, interval analysis, path analysis, attribution analysis, attribute analysis, and crowd creation. Single-value filtering supports only the "equal to" and "not equal to" operators.

  3. Example: A number of customers in a shop placed orders today. The contents of the orders are as follows:

    1. A customer orders melon seeds:

      commodity name: melon seeds

      Product Type: Nuts, Snacks, Processed Foods

      Commodity price: 12.00

    2. B customer order hawthorn

      commodity name: hawthorn

      Product Type: Desserts, Snacks, Processed Food

      Commodity price: 5.00

    3. c customer order bottle opener

      commodity name: bottle opener

      Product Type: Tools, Stainless Steel

      Commodity price: 18.00

When the number of buyers is grouped according to the single value of "commodity type", the grouping result is as follows:

Nuts: 1 person

Snacks: 2 people

Processed food: 2 people

Dessert: 1 person

Tools: 1 person

Stainless steel: 1 person

When the number of buyers is grouped by the original value of "commodity type", the grouping result is as follows:

[Nuts, Snacks, Processed Foods]:1 person

[Desserts, snacks, processed foods]:1 person

[Tools, stainless steel]:1 person

4.2 Group with Value, No Value Description

  1. Original value no value:

    1. Can't be converted to an array

    2. After converting the array, the array value only has empty strings and empty objects.

    3. The key is not reported.

  2. Single Value No Value:

    1. After the conversion to an array, only empty strings or empty objects exist for a single value.

The following table uses attribute b as an example to illustrate how values are parsed:

ID

Sample (ClickHouse database storage)

Original value of b

Whether the original value has a value

Whether a single value has a value

Original value group display

Single-value sub-display

1

{"a": "hello", "c": 123}

NULL

Not granted

No

Empty object (preset)

Empty object (preset)

2

{"a": "hello", "b": 123}

123

Not granted

No

Empty object (preset)

Empty object (preset)

3

{"a": "hello", "b": "s"}

"s"

Not granted

No

Empty object (preset)

Empty object (preset)

4

{"a": "hello", "b": ""}

""

Not granted

No

Empty object (preset)

Empty object (preset)

6

{"b": ["Nuts", "Snacks", "Processed Food"]}

['Nuts', 'Snacks', 'Processed Foods']

Yes

Yes * 3

['Nuts', 'Snacks', 'Processed Foods']

Nuts

Snacks

Processed food

7

{ "b": [null,""]}

[null,'']

Not granted

No

Empty object (preset)

Empty object (preset)

8

{"b": "[]"}

[]

Not granted

No

Empty object (preset)

Empty object (preset)

9

{"b": [""]}

['']

Not granted

No

Empty string (preset)

Empty string (preset)

9

{"b": ["", "Snack", "Processed Food"]}

['', 'snacks', 'processed food']

Yes

Yes * 2, No * 1

['', 'snacks', 'processed food']

Empty string (preset)

Snacks

Processed food

10

{"b": [null, "snack", "processed food"]}

[null, "snack", "processed food"]

Yes

Yes * 2, No * 1

[null, "snack", "processed food"]

Empty object (preset)

Snacks

Processed food

5. Overwrite if the user attribute is empty

If the user attribute "User Preference - user_preferences" reported for User A is:

"user_preferences":"['Elvish Maid', 'Super Buyer']"

and you then report:

"user_preferences":"[]"
"user_preferences":"[null]"

QuickTracking treats these as invalid and does not overwrite the user attribute. To clear the user attribute, report the following format:

"user_preferences":"['']"