- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
how do I set up an Audience where visitors are added on the date that it is their birthday (lets say I have DDMM) and then removed when it is no longer their birthday. Can enter Audience be triggered by the changing of (today) date?
If you are sending data to AudienceStream from a website or mobile web running iQ, then you can do this via a JavaScript extension.
The JS extension should just send through the current DDMM.
var d = new Date(); var dy = d.getDate(); var m = d.getMonth() + 1; var pad = function(i){ var pad = '0' + i; return pad.substring(pad.length-2); } b.as_today_ddmm = pad(dy) + pad(m);
In AS, you can compare this with the visitor property birthday DDMM. If there is a match, assign a badge, and if there is not a match, remove the badge.
There isn't a way to do this purely in the UDH - you cannot calculate the DDMM purely in the UDH. There is the ability to calculate the difference between two dates in the UDH, but because of leap years and such things, this is not suitable for working out if it is someone's birthday.
Copyright All Rights Reserved © 2008-2023