The Date Attribute stores the date of an event, such as First Purchase Date or Last Visit Date.
In this article:
Use the following steps to create a date:
In the Notes field, enter any comments or annotations.
Scope specifies how long the data describing the visitor or the visitor's current session/visit persists.
Rules define the precise conditions that determine when to enrich an attribute. When configuring a new Attribute, you have the option to apply a predefined rule or create a new rule.
Use the following steps to apply a predefined rule:
This section contains two simple exercises, one for each enrichment, to illustrate how you can implement a Date type to accomplish different goals.
The timestamp is captured at the instant the visitor lands on the receipt or thank-you page of your site, confirming the visitor's purchase.
Step 1. Add a new Date Attribute. Give it a title and set the scope to Visitor.
Title: Last Purchase Date Scope: Visitor
Step 2. Create the Capture Date Enrichment and apply a Rule to check if the visitor landed on the order confirmation page.
Capture the date and time when the following conditions are met. WHEN: Any page event Attach/Create Rule: Current URL contains(ignore case) "receipt.html"
Step 3. Save/Publish the changes.
Result: If the Rule evaluates to 'true', the Enrichment is triggered and the timestamp of the purchase is captured. On the other hand, no timestamp is captured if the Rule fails.
This requires two Attributes: a Date type to identify the visit and a Boolean type to check if that visit ended with/without an order submission. The Boolean acts a on Rule condition in the Date type, which is also why it needs to be configured first.
Step 1. Create a Boolean Attribute. Scope it to Current Visit.
Title: Order Submitted Scope: Current Visit
Set to "True" WHEN: Any page event. Attach/Create Rule: Page URL contains (ignore case) "receipt.html"
Set to "False" WHEN: New Visit
Step 2. Add a Date Attribute, then create the Set Date Enrichment.
Title: Last session without a purchase Set Date to: Visit End (Preloaded Attribute available in the dropdown) WHEN: Visit ended Attach/Create Rule: 'Order Submitted' Flag Is False.
Step 3: Save/Publish the changes.
Result: If the visitor ends the visit without buying anything, the Flag is set to 'false' and the corresponding date of the visit is stored.