Save Date type fields in analytics and perform time intelligence operations | Community
Skip to main content
May 31, 2023
Solved

Save Date type fields in analytics and perform time intelligence operations

  • May 31, 2023
  • 2 replies
  • 975 views

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`?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

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.

2 replies

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
May 31, 2023

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.

yuhuisg
Community Advisor
Community Advisor
June 1, 2023

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.

yuhuisg
Community Advisor
Community Advisor
June 1, 2023

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.