In this article, you'll learn how to create rules to control the dates and times a customer can qualify for your promotions.
Using date or time attributes you can create rules so campaigns run/don't run on certain days or at certain times of day.
Defining specific dates and times where campaigns will take effect or not in the Rule Builder gives you a lot more flexibility and granularity with your promotions than simply setting a start- and an end-date for your campaign.
Here's a scenario to show how you might use this feature:
Let's say you run a travel company and you're selling tickets for journeys. For this, you'll need to create a campaign where customers redeeming coupons will get 10% off their ticket price, as long as the journey date is not on a public holiday.
Creating a Campaign
To begin with, let's set up a campaign with coupons so that you can start building rules.
If you haven't set up a campaign before, check out our article on Creating a Campaign.
Once that's ready, let's create an example of how you might use dates.
A company selling tickets like this will usually have a custom time attribute set up in their system to track the date and time of the journey cart item, so let's create one now.
Creating a Time Attribute with Suggestions
If you haven't created a Custom Attribute already, you should take a look at Creating Attributes.
From your Application dashboard:
- Go to Developer tools on the right and click "See Developer section".
- The first page that loads is Attributes.
- Then click + Create Attribute in the top right.
On the Create Attribute page:
- Set the Associated Entity to "Cart Item".
- Then Attribute type to "Time".
- Give this attribute a permanent internal (developer-facing) name. (eg. "travelDate")
- Give it an editable Title (eg. Travel Date)
- Add a short description of this attribute (eg. "Day's that a customer travels on")
Finally, click the Suggestions field and select "Add Date" to open the calendar. Here's where you'll enter all the public holiday days for this year.
Take a look through the calendar and add any date you'd like to this list by clicking on its number. Doing this adds these dates to a convenient drop-down menu you can use later in the Rule Builder.
When you've selected all the ones you want, click "Create Attribute" to finalize it.
Creating a Date-Based Cart Item Filter
If you haven't created one of these before, check out our article on Cart Item Filters.
Now that you have an attribute, let's build a simple rule;
When a customer redeems a coupon, they get 10% off their ticket as long as the coupon is valid and the Travel Date is not a local holiday.
Navigate to the Rule Builder, and then:
- Click + Add Rule
- Name your rule
- Click Filter Cart Items
- Choose "Set a filter condition"
Check that the current date is not a holiday with the condition:
- Travel Date (The attribute you created)
- Is not one of
- Our holiday dates from earlier, chosen from the drop-down suggestions
Here's the menu of suggestions you created earlier. You can pick and choose any of the dates you set out earlier for your filter and you can even + Add Dates right here in the filter.
Let's call this filter "journeys_valid_for_discount" and save.
Creating a Condition
The condition for this rule will simply be "Coupon code is valid", to ensure that as well as being on a correct date, a valid coupon is being used.
Creating an Effect
Lastly, create an Effect for the rule, "Set an item discount", and pass your new Cart Item Filter "journeys_valid_for_discount" as the list of items.
Then set it to take 10% off the price and save your rule.
When this campaign is activated, customers using a valid coupon will receive 10% off their ticket price as long as the journey doesn't happen on a public holiday.
Alternatively, you could offer free shipping or award loyalty points. Or you could offer discounts ONLY on public holidays; anything you like, depending on your needs and which features you have activated for this Talon.One campaign.
Now you know how to create and get started with Dates and Time in Talon.One.
Next, you might want to check out: