Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

The correct time format to pass so that a time based report/alert can be used

Avatar

Level 1

Hello everyone.

 

I have a requirement to add the last published Date-time on a standard pageview event so that we can see when the last time a page was updated (keeping content up to date and relevant). 

 

The developers can pass this in any format I need but I'm struggling to find any documentation around what format to use so that I can evaluate the hours/days/months between to setup different alerts (some content may need an alert triggering after a few hours, some a few days and most 6 months or so)

 

Has anyone done something similar? if so in which format did you pass the Date time to an eVar/Event etc?

1 Accepted Solution

Avatar

Correct answer by
Level 1

That's absolutely brilliant.

I already use the plugin for another eVar and I'm familiar with creating classifications so I'll be sure to leverage that here too.

 

Thank you so much for you help. I won't see the development changes for a few weeks yet (prod a bit more) but I'll be sure to come back here once I do.  

View solution in original post

5 Replies

Avatar

Employee Advisor

@malixx4 - ISO 8601 can be one of the formats that you can use to pass timestamp. Dates and times expressed in ISO 8601 can take several different forms. Adobe does not support all features in ISO 8601.

  • Both the date and time must be provided, separated by T.
  • Hours and minutes are required; seconds are optional but recommended.
  • Week dates and ordinal dates are not supported.
  • The date can be in standard or extended format. For example, 2020-01-01T00:00:00Z and 20200101T000000Z are both valid.
  • Fractional minutes and seconds are technically valid, but the fractions are ignored by Adobe.
  • Time zones are supported in standard and extended formats.

Further, this can be passed to an evar. But how do you plan to evaluate the value to find hour, month, day to setup alerts based on those values? 

Avatar

Level 1

Hello @Ishan_Sinha_ 

 

Thank you for the info and speedy response.

Initially I wanted to make sure that what I requested to be pushed to the page dataLayer would be usable in both reporting (getTimeParting) and somehow* for alerts to trigger.

 

Do you have any ideas on how alerts (based on time elapsed) could be achieved? 

Avatar

Employee Advisor

@malixx4 - You could use classification to classify timestamp captured in an evar into Day, Month, etc. Further, Alerts can be set on those classified values: https://experienceleague.adobe.com/docs/analytics/analyze/analysis-workspace/virtual-analyst/intelli....

Another alternative is to use the getTimeParting plug-in as suggested by @Pankaj_Sabharwal .

Thanks!

Avatar

Level 5

Hi @malixx4 

 

The solution to your problem is to use getTimeParting plugin & you can get the time in your desired TimeZone captured in an eVar.

var tpA = s.getTimeParting('n','-7');

s.eVarX = tpA.split('|')[0]; // time at minute level

Reference documentation for the same - getTimeParting

Date / Date range you can always choose for the report whenever you run them in Adobe Analytics.

I also recommend using Classifications to break it out by:

Day of Week, Month, AM v PM, Weekday vs Weekend.

 

Thanks.

Avatar

Correct answer by
Level 1

That's absolutely brilliant.

I already use the plugin for another eVar and I'm familiar with creating classifications so I'll be sure to leverage that here too.

 

Thank you so much for you help. I won't see the development changes for a few weeks yet (prod a bit more) but I'll be sure to come back here once I do.