Dataphin allows you to define calculation rules for tags through expressions, utilizing both offline and real-time tag calculation results as tag values. This guide will walk you through the process of creating real-time tags using expressions.
Prerequisites
Before creating real-time tags with expressions, ensure you have created the corresponding real-time view. For more information, see Create and Configure Real-Time Views.
Procedure
On the Dataphin home page, navigate to the top menu bar and select Tag > Tag Workbench.
In the left-side navigation pane, choose Tag Processing > Realtime Tag.
On the Real-Time Tag page, click the In-Project Tag tab. Then, under the In-Project Tag tab, click Add Tag.
In the Add Real-Time Tag dialog box, select Expression-Based Tag.
On the Add Expression Creation configuration page, fill in the basic information for the real-time tag, including Business Attributes and Technical Attributes.
Business Attributes
Parameter
Description
Tag Name
Enter the tag name. It can include Chinese characters, English letters, numbers, and underscores (_), and must not exceed 64 characters.
Entity-Entity ID
Select the necessary entity and its corresponding entity ID for the real-time tag processing.
Tag Type
Classify tags by their processing method. Available types include:
Attribute Tag: Describes objective facts and is a basic tag for entity profiles, such as gender and name.
Statistical Tag: Created based on business needs through statistical calculations on entity behavior or attributes, like the purchase amount in the last 7 days.
Predictive Tag: Forecasts entity characteristics or behavior using algorithm models, such as predicting a user's permanent province.
Composite Tag: Formed by applying specific rules to process multiple tags, such as consumer segmentation tags.
Timeliness
Defines the update frequency of tags as they evolve over time, categorized into dynamic and static:
Static Tag: Typically represents inherent characteristics of an entity that do not change, such as gender and name.
Dynamic Tag: Requires regular updates to reflect changes over time, such as the order amount in the last 7 days.
Tag Description
Provide a brief description of the tag, limited to 1000 characters.
Technical Attributes
Parameter
Description
Tag Code
A globally unique identifier for the tag, aiding in locating specific tags when names are identical or when creating online services. It must begin with a letter and can include lowercase English letters, numbers, and underscores (_), within 64 characters.
Tag Update Method
Real-time tags support only the real-time update method and cannot be altered.
Tag Owner
Designate the owner of the real-time tag.
Navigate to the Add Rule Combination configuration page, step 2, and set up the Processing Logic for the real-time tag.
Parameter
Description
Version Number
Specify your version number, which can include letters, numbers, underscores (_), hyphens (-), and periods (.), within 64 characters.
Value Type
Indicate the value type for the real-time tag. The default is String and is not subject to change.
Tag Configuration
Configure the tag by clicking
to reference existing tags.Syntax Reference:
Arithmetic Operations: Supports addition (+), subtraction (-), multiplication (*), and division (/).
Logical Operations: Includes and (&&), or (||), and not (!).
Relational Operations: Encompasses greater than (>), less than (<), greater than or equal to (>=), less than or equal to (<=), equal to (==), and not equal to (!=).
To finalize the creation, click Submit.
Once the real-time tag is created, it must be published for it to be used normally.
In the real-time tag list, click the
button in the operation column to initiate the publishing process.In the Publish Tag dialog box, choose the tag version to publish.
NoteBefore publishing, you may click View Version Comparison to review the details and differences between versions, ensuring accuracy before proceeding.
Click Confirm to complete the tag's publication.
What to do next
After creating and publishing the real-time tag, proceed to list the tag in the appropriate market for management and utilize it in further tag development activities. For more information, see Manage Tags.