I've set up a number of hourly alerts. I am wondering if it is possible to restrict the hours that the alerts check? For example, is it possible to exclude the hours of 1am - 6am? Has anyone been able to do this. Thanks!
This is absolutely possible using 'if' statements in calculated metrics (we do this all the time).
Imagine the scenario where you wanted to create an alert when 'orders' are less than or equal to 1000.
Create a 'hit' level segment called 'non-core hours'
'hour of day' is greater than or equal to '1:00am'
'hour of day is less than or equal to '6:00am'
Create a calculated metric called 'Core hours orders'
using the 'if' function
within 'logic_test' place your 'non-core hours' segment with the 'occurences' metric nested inside it
within 'value_if_true' add a 'Static Number' with a value of '1001' (Note: this needs to be any value which would not trigger an alert, in this case greater than 1000)
within 'value_if_false' add the 'Orders' metric
Create an hourly granularity Alert called 'core hours order alert' where:
the calculated metric 'core hours orders' is below or equals '1000'
During the night 1am to 6:59am as long as you get at least 1 hit in each hour, the value will always be 1001 so the alert never triggers. During the rest of the day it will tigger if orders is equal or below 1000.
NOTE: this method also works for the 'anomaly exceeds' alerting option. If you set a Static Value at the same time every night anomaly detection does not see it as an anomaly (because it is the same every night).
I'm afraid that it will be sent every hour, since alerts currently do not offer the capability to customize what time/day they are sent. You could create an inbox rule in Outlook or another mail program to filter out the non-peak hours as a workaround, though.