Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!
SOLVED

Calculate Age Adobe Analytics

Avatar

Community Advisor

Hello everyone,

Currently my client is acquiring from the "Registration Form"  Month and Year  (Born) Seeing that my client wants to calculate Age, anyone knows how to do? 

I am thinking of create a js custom code in the Registration Form which calculates the age during signup but how Analytics updates every year?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 8

I suggest you first check with your client on what he/she is going to do with it and what kind of reports he is going to generate.

The implementation varies based on the reports, you can use classifications something like name:dob:location and create classification builder to build buckets ( 20 - 30 ), ( 30 - 40 ), etc. but this also be problem when it comes to next year.

(or) you can use separate eVar for this, what you need to do is here, you need to calculate age at front end and pass it to the registration event but the problem here is it will not updated every year. the important thing which you need to check is what he/she wants, current DOB or age at the time of registration? 

 

I never tried for dates but, you can also try creating segments for age groups

 

 

View solution in original post

2 Replies

Avatar

Level 8

Hi there,

 

Firstly you need to be careful if you capturing this information because of GDPR. It's worth checking your legal team is happy but providing they are, I would actually go with the simple solution of using javascript datediff and a getdate(), so no updating is required.

 

https://www.w3resource.com/javascript-exercises/javascript-date-exercise-8.php

 

Thanks

 

Dave

Avatar

Correct answer by
Level 8

I suggest you first check with your client on what he/she is going to do with it and what kind of reports he is going to generate.

The implementation varies based on the reports, you can use classifications something like name:dob:location and create classification builder to build buckets ( 20 - 30 ), ( 30 - 40 ), etc. but this also be problem when it comes to next year.

(or) you can use separate eVar for this, what you need to do is here, you need to calculate age at front end and pass it to the registration event but the problem here is it will not updated every year. the important thing which you need to check is what he/she wants, current DOB or age at the time of registration? 

 

I never tried for dates but, you can also try creating segments for age groups