Expand my Community achievements bar.

SOLVED

Save Date type fields in analytics and perform time intelligence operations

Avatar

Level 2

On my website I have stories that are published periodically. On the Adobe Analytics dashboard I want to see the views on the stories published in the last 7 days.

For this I plan to send the published date of the story to AA Server using a conversion variable each time a story is opened (clicked). But Adobe Analytics does not have a data type Date, I am able to send the date only as a string.

Is it possible to save the date as a Date data type and use Time Intelligent operations like `daysBetween(today, publishedDate) <= 7`?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

No, unfortunately Adobe Analytics doesn't support date fields....

 

The only possibility is to use something like Report Builder in Excel, then you can convert the text to date, and use Excel Date functions like =Today() and create those type of math functions....

 

I don't know if CJA will allow for more data types, like dates, since I don't have CJA.... but I work for a Newspaper / Media company too.. and being able to get publish dates as "date" would be awesome.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

No, unfortunately Adobe Analytics doesn't support date fields....

 

The only possibility is to use something like Report Builder in Excel, then you can convert the text to date, and use Excel Date functions like =Today() and create those type of math functions....

 

I don't know if CJA will allow for more data types, like dates, since I don't have CJA.... but I work for a Newspaper / Media company too.. and being able to get publish dates as "date" would be awesome.

Avatar

Community Advisor

Adding on to @Jennifer_Dungan 's answer:

The reason you can't set eVar values as date type is because eVar values are always of string type.

Furthermore, you can't execute any kind of functions on eVar values. Adobe Analytics will only ever report the tracked string values.

You may consider these as "limitations" in Adobe Analytics, but that's just how the product has been designed.

Avatar

Community Advisor

Thinking about this in another way:

Since your requirement is to know how many days it has been between the published date and the current date, i.e. the date when the article is read, how about tracking that difference in days to your eVar? i.e.

// assuming the viewed article was published on 13 May 2023
var currentDate = new Date();
var publishedDate = new Date('2023-05-13');
var numMillisecondsDifference = currentDate.getTime() - publishedDate.getTime();
var numDaysDifference = numMillisecondsDifference / 1000 / 60 / 60 / 24;
s.eVarX = Math.floor(numDaysDifference);

You can then run a report with the following with the "Day" dimension broken down by your eVar. When reported with the relevant metric(s), then for each Day that your article was viewed, you can also see how many days it had been since the article had been published.