Back

The Date Attribute stores the date of an event, such as First Purchase Date or Last Visit Date.

In this article:

Table of Contents Placeholder

Create a Date

Use the following steps to create a date:

  1. Enter a descriptive Title for the attribute.
  2. In the Notes field, enter any comments or annotations.

    date_config.png

  3. In the Notes field, enter any comments or annotations.
  4. Set the Scope to Visitor or Current Visit.

    Scope specifies how long the data describing the visitor or the visitor's current session/visit persists.

    • Visitor
      Select this if the Attribute describes the visitor or if this data has to persist longer than the visit. Attributes scoped to Visitor persist after the current visit ends.
    • Current Visit
      Select this if the Attribute describes the current visit. Attribute values scoped to Current Visit do not persist longer than the visit.

Add an Enrichment

Use the following steps to add an enrichment:

  1. Click Create An Enrichment and select an Enrichment from the list.
    • Capture Date: Captures the timestamp of an event based on the condition you specify.
      capture_date_enrich.png
    • Set Date to: Sets this instance of the Attribute to the date you specify here.
      set_date_enrich.png
  2. Select a trigger from the WHEN drop-down list.
    This tells AudienceStream when to listen for changes that require enriching the Date.
    • New Visitor: Enrichment will occur when the visitor is new to your site.
      when_dropdown.png
    • New Visit: Enrichment will occur on a new visit by a visitor.
    • Any page event: Enrichment will occur on any page where your rule conditions are met. If you're not certain which selection to make, choose this one.
    • Visit ended: Enrichment will occur when a visit ends.
  3. To create additional enrichments, repeat Steps 1 and 2.

Apply a Rule

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:

  1. Make a selection from the drop-down list and click Attach Rule.
  2. To apply a new rule, click Create a Rule.
    Adding a new rule from the Enrichments dialog automatically applies it to the enrichment.
    For more information on how to create a new rule, click here.
  3. Click Save/Publish to save and publish the changes to your profile.
    Your date attribute configuration is complete. 

Usage Examples

This section contains two simple exercises, one for each enrichment, to illustrate how you can implement a Date type to accomplish different goals.

Last Purchase Date

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"

last_purchase_date.png

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.

Last Session Without a Purchase

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

order_submitted_flag.png

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.

last_session_no_purchase.png

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.