Happy Birthday Audience

Bronze Contributor
Bronze Contributor

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?

2 REPLIES 2

Happy Birthday Audience

Tealium Employee

@catherinecSB

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.

Happy Birthday Audience

Moderator
Moderator
@catherinecSB

Mark's answer is valid if the person's birthday is on the day they happen to visit your site. I think, however, your question was this:

"If I visit the site/app today, and specify that my birthday is on a given date in, for example, 5 months' time, can AudienceStream automatically add the visitor to the "Happy Birthday" audience on the date of their birthday, regardless of whether they have visited on that particular day; a kind of "deferred" audience addition."

This is currently not possible. Adding or removing a visitor to/from an audience can only take place when an event occurs (*see exception described below). To achieve something like what you have described, you would have to artificially trigger an event every day of the year for each known visitor and see if the current date matches the birthday set in their profile. This is clearly not a practical solution. You could perhaps narrow this down by doing an extract from your CRM tool for all known customers with a birthday of "today" (the current date), and passing this into AudienceStream using Omnichannel. This may be more practical, but is still not an ideal solution, and I wouldn't recommend it.

I think your best bet is to create a Product Idea (https://community.tealiumiq.com/t5/Announcements/Introducing-Product-Ideas/td-p/20949), and we'll see if it's feasible to add this to the product in future.

*The exception I mentioned above is that you can have a "delayed" action, which can be scheduled for a set number of hours/days after the visit ends. This is a static value, so is not suitable for this particular use case (e.g. you could schedule an email to be sent 14 days after a visit ends, but you couldn't schedule it to be sent based on a dynamic date stored in the visitor profile). Read more about delayed actions here: https://community.tealiumiq.com/t5/Universal-Data-Hub/Delayed-Actions-for-Connectors/ta-p/17575
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Public