Calculate Age Adobe Analytics

1982luca

25-06-2020

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

Accepted Solutions (1)

Accepted Solutions (1)

rajas66269496

26-06-2020

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

 

 

Answers (1)

Answers (1)

David-123

26-06-2020

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