SDITools / adobeanalyticsr

R Client for Adobe Analytics API v2.0
Other
18 stars 9 forks source link

Creating aw_freeform_table for specific time frame #157

Closed aparada96 closed 1 year ago

aparada96 commented 1 year ago

Hello, I am trying to create an aw_freeform_table() to pull in streaming data during a specified time frame. As a sports media company, a game broadcast will occasionally go over (or under) the scheduled time. Thus, I wish to be able to track related analytics during a custom time period. The code below is what I attempt to enter but _daterange ignores the time entered- instead, it pulls in the data for the entire day. Is there a different parameter within aw_freeform_table that I am neglecting or am I entering the time format incorrectly?

Thank you in advance, @aparada96

aw_freeform_table(rsid = 'yesnet-pro',
                  date_range = c("2023-02-28 19:30:00", "2023-02-28 21:54:28"), 
                  metrics =  c("visitors", "videostart","videototaltime"),
                  dimensions = "videoname",
                  prettynames = T,
                  segmentId = "s300010361_606a133b8fb2df841f0fa7",
                  top = 25) 
benrwoodard commented 1 year ago

Great question! There is a way to accomplish this. Use the following argument: date_range = as.POSIXct(c("2023-02-28T19:30:00", "2023-02-28T21:54:28"), format = "%Y-%m-%dT%H:%M:%S")

aparada96 commented 1 year ago

Thank you so much @benrwoodard! I use the AdobeAnalyticsR package daily at work and it makes my work much easier. I will follow up if I have any other questions.