This if here adds some performance degradation when using only page level events.