I'm having trouble identifing a good way to unassign a badge after a number of days have passed since itw as first assigned.
ie. I assign the badge on monday, and I want it to get Unassigned after 5 days.
- creating a Date attribute that gets set when the bade is assigned. then creating a rule for unassigning the badge when that date is > 5 days ago.
But that creates a cyclical logic error when saving the badge. (bug fix? i know it's somewhat cyclical, but i woulnd't expect it to cause issues).
My next try to to create duplicate badges. create the date off of one badge, and then have the expiration apply to the 2nd badge. I tihnk this should work - but it's a silly way to implement...
You'll probably need to reference a Timeline. You'll move the logic to assign the Badge to the Timeline, use a Number to count the number of entries in the Timeline, then assign a Badge if the Number is greater than or equal to 1.
You might want to add additional logic to the Timeline rule to only add an entry if the Metric equals 0. This all depends if you want to let the Badge be assigned if they've done something in the last 5 rolling days no matter how many times the rule was evaluated to true, or if they should only be in the audience for 5 days no matter what.
Hope this helps!
Thx for reply. I've tried the timeline approach, but am still having isues with the expiration. I'm trying to for the "can only be in the timeline once every 5 days".
Timeline captuing valid behavior
Number capturing count of hits in timeline
Problem: when I try to make the number part of the rules in capturing events in the timeline, I get a cyclic logic error and am unable to save/publish.
Any other options?
To ping back on this thread - there is not an ability to currently do this cleanly in Audience stream.
However, there are some hacks, below:
1. You can use AudineceSTream in conjunction with iQ.
---> Create your audience in AS as normal,
---> find in the enhanced datalayer in iQ the timestamp for when teh audience was entered.
--> chckin an JS extensionin iQ if the current date is X days after the audience join date. if so, set a datalayer flag for AS to pick up as an event variable.
--- in AS, make a Remove Audience condition based around that flag.
2. (havent' tried this one, but it should work). Use AudienceStream webhook connectors to create a GET request hitting your own AudienceStream implementation.
--> set up the conector to fire when a user enters an audience. and have the GET request send the tealium ID, as well as some kinda flag designating that the audience was entered.
--> set up a Date attribute that gets set to teh current date when the above flag is found.
--> set up removal from the audience when the current date is more than 5 days ( or X days) after the Date attribute you created.
Or, I suppose you could send the connector/Webhook action 5 day safter the audience is joined, and use the flag to remove the person from the audience as well.
Hope this helps other people.. was a bit of a pain to figure out
I know it's been a little while since you asked, so sorry for the delay in responding
01-15-2019 06:11 PM - edited 01-15-2019 06:12 PM
@mark_reddin would this still work if no events come in for that particular visitor? My understanding is that the badge will remain assigned until an event for that visitor comes in. The problem being, if your visitor goes away and no more new events are coming in for them you still want the badge to be unassigned after X days.
@AndrewFenn You are correct. The above requirement and pattern were for the case where the visitor is returning to the site or there is some other event (omnichannel or collect API) that "wakes up" the visitor profile and recalculates everything.
Depending on what you are doing, there are two things to consider;
1. A filter in Audience Sizing based on the Date you've stored in Visitor Profiles versus the date now will work correctly. So you could use Sizing to find visitors whose Date is more than X days ago.
2. Delayed connectors may also suit what you are doing.